Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DEBUG = 1
var ERROR = 4
var FATAL = 5
var INFO = 2
var Logger = logger{}
var TRACE int = 0
var WARNING = 3
Functions ¶
func LogMeasurement ¶
func LogMeasurement(metric string, params map[string]string, elapsed time.Duration, result string, err error)
Store given measurement
func Measure ¶
func Measure(fn interface{}, params ...interface{}) (interface{}, error)
Measure duration of a given function run with given parameters and return what function returned This only returns first (data) and last (error) returned value. Maybe this can be generalized completely, but it is good enough for our needs.
func MeasurementsStart ¶
func MeasurementsStart(directory string)
Initialize channels and start functions that are processing records
func MeasurementsStop ¶
func MeasurementsStop()
Close channels and wait to ensure any remaining records are written to CSV
Types ¶
type ErrorEntry ¶
Represents the data about failure we want to store to CSV
func (*ErrorEntry) GetSliceOfStrings ¶
func (e *ErrorEntry) GetSliceOfStrings() []string
Helper function to convert struct to slice of string which is needed when converting to CSV
type MeasurementEntry ¶
type MeasurementEntry struct { Timestamp time.Time Metric string Duration time.Duration Parameters string Error error }
Represents the data about measurement we want to store to CSV
func (*MeasurementEntry) GetSliceOfStrings ¶
func (e *MeasurementEntry) GetSliceOfStrings() []string
Helper function to convert struct to slice of string which is needed when converting to CSV