Documentation
¶
Index ¶
- Constants
- func AppOptics(registry metrics.Registry, interval time.Duration, token string, ...)
- func SetHTTPClient(c *http.Client)
- type AppOpticsClient
- type Batch
- type Measurement
- type Reporter
- type TaggedMetric
- func (t *TaggedMetric) Counter() metrics.Counter
- func (t *TaggedMetric) Gauge() metrics.Gauge
- func (t *TaggedMetric) Gauge64() metrics.GaugeFloat64
- func (t *TaggedMetric) Histogram() metrics.Histogram
- func (t *TaggedMetric) Meter() metrics.Meter
- func (t *TaggedMetric) String() string
- func (t *TaggedMetric) Tag(name string, value interface{}) *TaggedMetric
- func (t *TaggedMetric) Timer() metrics.Timer
- func (t *TaggedMetric) WithSample(s func() metrics.Sample) *TaggedMetric
Constants ¶
View Source
const ( // display attributes Color = "color" DisplayMax = "display_max" DisplayMin = "display_min" DisplayUnitsLong = "display_units_long" DisplayUnitsShort = "display_units_short" DisplayStacked = "display_stacked" DisplayTransform = "display_transform" // special gauge display attributes SummarizeFunction = "summarize_function" Aggregate = "aggregate" // metric keys Name = "name" Period = "period" Description = "description" DisplayName = "display_name" Attributes = "attributes" // measurement keys Time = "time" Tags = "tags" Value = "value" // special gauge keys Count = "count" Sum = "sum" Max = "max" Min = "min" StdDev = "stddev" // batch keys Measurements = "measurements" )
property strings
View Source
const Operations = "operations"
View Source
const OperationsShort = "ops"
View Source
const PartialFailureHeader = "x-partial-failure"
Variables ¶
This section is empty.
Functions ¶
func AppOptics ¶
func AppOptics(registry metrics.Registry, interval time.Duration, token string, tags map[string]string, percentiles []float64, timeUnits time.Duration, prefix string, whitelistedRuntimeMetrics []string, measurementsURI string)
Call in a goroutine to start metric uploading. Using whitelistedRuntimeMetrics: a non-nil value sets this reporter to upload only a subset of the runtime.* metrics that are gathered by go-metrics runtime memory stats (CaptureRuntimeMemStats). The full list of possible values is at https://github.com/rcrowley/go-metrics/blob/master/runtime.go#L181-L211 Passing an empty slice disables uploads for all runtime.* metrics.
func SetHTTPClient ¶
Types ¶
type AppOpticsClient ¶
func NewAppOpticsClient ¶
func NewAppOpticsClient(token, measurementsURI string) *AppOpticsClient
func (*AppOpticsClient) PostMetrics ¶
func (self *AppOpticsClient) PostMetrics(batch Batch) (err error)
type Batch ¶
type Batch struct { Measurements []Measurement `json:"measurements,omitempty"` Time int64 `json:"time"` Tags map[string]string `json:"tags"` }
type Measurement ¶
type Measurement map[string]interface{}
type Reporter ¶
type Reporter struct { Token string Tags map[string]string Interval time.Duration Registry metrics.Registry Percentiles []float64 // percentiles to report on histogram metrics Prefix string // prefix metric names for upload (eg "servicename.") WhitelistedRuntimeMetrics map[string]bool // runtime.* metrics to upload (nil = allow all) TimerAttributes map[string]interface{} // units in which timers will be displayed // contains filtered or unexported fields }
func NewReporter ¶
func (*Reporter) BuildRequest ¶
type TaggedMetric ¶
type TaggedMetric struct {
// contains filtered or unexported fields
}
func Metric ¶
func Metric(name string) *TaggedMetric
func (*TaggedMetric) Counter ¶
func (t *TaggedMetric) Counter() metrics.Counter
func (*TaggedMetric) Gauge ¶
func (t *TaggedMetric) Gauge() metrics.Gauge
func (*TaggedMetric) Gauge64 ¶
func (t *TaggedMetric) Gauge64() metrics.GaugeFloat64
func (*TaggedMetric) Histogram ¶
func (t *TaggedMetric) Histogram() metrics.Histogram
func (*TaggedMetric) Meter ¶
func (t *TaggedMetric) Meter() metrics.Meter
func (*TaggedMetric) String ¶
func (t *TaggedMetric) String() string
func (*TaggedMetric) Tag ¶
func (t *TaggedMetric) Tag(name string, value interface{}) *TaggedMetric
func (*TaggedMetric) Timer ¶
func (t *TaggedMetric) Timer() metrics.Timer
func (*TaggedMetric) WithSample ¶
func (t *TaggedMetric) WithSample(s func() metrics.Sample) *TaggedMetric
Click to show internal directories.
Click to hide internal directories.