Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Profile ¶
type Profile struct { Name string `json:"name"` // name identifies the measured quantity ("fetchSingle() or api.GetAllMetrics()") Description string `json:"description,omitempty"` Start time.Time `json:"start"` // the start time of the task Finish time.Time `json:"finish"` // the end time of the task }
A Profile is a single data point collected by the profiler.
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler contains a sequence of profiles which are collected over the course of a query execution.
func (*Profiler) AddProfile ¶
func (*Profiler) Do ¶
Do will perform and time the action given. It behaves in a threadsafe manner. If the profiler is nil, the action will be performed, but no profile will be recorded.
func (*Profiler) Flush ¶
Flush provides a safe way to clear the profiles from its list. It's guaranteed that no profiles will be lost by calling this method.
func (*Profiler) Record ¶
Record will create a profile of the given name from `start` until the current time. Record acts in a threadsafe manner.
func (*Profiler) RecordWithDescription ¶
Click to show internal directories.
Click to hide internal directories.