MCPcopy Create free account
hub / github.com/AdRoll/baker / Stats

Method Stats

stats_test.go:75–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73type statsUpload struct{ uploadtest.Base }
74
75func (statsUpload) Stats() baker.UploadStats {
76 bag := baker.MetricsBag{}
77 bag.AddRawCounter("upload.raw_count", 12)
78 bag.AddDeltaCounter("upload.delta_counter", 9)
79 bag.AddGauge("upload.gauge", math.Pi*4)
80 bag.AddHistogram("upload.hist", []float64{8, 9, 10, 11})
81 bag.AddTimings("upload.timings", []time.Duration{1 * time.Microsecond, 10 * time.Microsecond, 100 * time.Microsecond})
82
83 return baker.UploadStats{
84 NumProcessedFiles: 17,
85 NumErrorFiles: 3,
86 CustomStats: map[string]string{"k5": "v5", "k6": "v6", "k7": "v7"},
87 Metrics: bag,
88 }
89}
90
91func TestStatsDumper(t *testing.T) {
92 // Check that the StatsDumper correctly reports the metrics gathered from

Callers

nothing calls this directly

Calls 5

AddRawCounterMethod · 0.95
AddDeltaCounterMethod · 0.95
AddGaugeMethod · 0.95
AddHistogramMethod · 0.95
AddTimingsMethod · 0.95

Tested by

no test coverage detected