# README
go-commons/perfmonitoring
Common library for storing data in InfluxDB.
Sample usage:
perfMon, err := NewPerfMonitoring("my_app", "metrics")
if err != nil {
t.Fatal(err)
}
perfMon.Set("ResponseTime", []interface{}{measuredValue})
perfMon.Push()
You can also use the timer object which automates time tracking for a given scope:
func closeTimer(timer *perfmonitoring.Timer) {
err := timer.Close()
if err != nil {
logger.GetLogger().ErrorErr(err)
}
}
func TimerMeasuredFunc() {
timer := NewTimer(perfMon, "test_time")//Starts time measurement
defer closeTimer(timer) //After function finishes measured time will be pushed to InfluxDB
//Your code goes here
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Note that this object is designed to be used in a single thread
If you have a multithreaded application, then it is recommended to create a new PerfMonitoring
instance for each thread/request.
No description provided by the author
# Interfaces
No description provided by the author