TanmoySG / wunderDB

A micro JSON-based Data Store inspired by MongoDB.
http://wdb.tanmoysg.com/api/
Apache License 2.0
12 stars 0 forks source link

[Design] Design approach to track Metrics #73

Open TanmoySG opened 1 year ago

TanmoySG commented 1 year ago

Design approach to track various metrics for

TanmoySG commented 1 year ago

Time Tracking for functions

func timeTrack(start time.Time, name string) {
    elapsed := time.Since(start)
    log.Printf("%s took %s", name, elapsed)
}

// usage in function 

func SomeFunction(empIDs []string) string {
    defer timeTrack(time.Now(), "someFunction")
}

Output

image