Added telemetry for counting stored samples

Change-Id: I0f36f7c2738d070ca2f107fcb315f98e46803af3
This commit is contained in:
Stuart Nelson 2013-12-11 20:21:37 -05:00
parent 3bf3a555b2
commit 28f59edf16
2 changed files with 4 additions and 0 deletions

View file

@ -72,6 +72,7 @@ var (
storageOperationDurations = prometheus.NewCounter()
storageLatency = prometheus.NewHistogram(diskLatencyHistogram)
queueSizes = prometheus.NewGauge()
storedSamplesCount = prometheus.NewCounter()
)
func recordOutcome(duration time.Duration, err error, success, failure map[string]string) {
@ -94,4 +95,5 @@ func init() {
prometheus.Register("curation_filter_operations_total", "The number of curation filter operations completed.", prometheus.NilLabels, curationFilterOperations)
prometheus.Register("curation_duration_ms_total", "The total time spent in curation (ms).", prometheus.NilLabels, curationDuration)
prometheus.Register("curation_durations_ms", "Histogram of time spent in curation (ms).", prometheus.NilLabels, curationDurations)
prometheus.Register("prometheus_stored_samples_total", "The number of samples that have been stored.", prometheus.NilLabels, storedSamplesCount)
}

View file

@ -21,6 +21,7 @@ import (
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
clientmodel "github.com/prometheus/client_golang/model"
@ -168,6 +169,7 @@ func (t *TieredStorage) AppendSamples(samples clientmodel.Samples) (err error) {
}
t.memoryArena.AppendSamples(samples)
storedSamplesCount.IncrementBy(prometheus.NilLabels, float64(len(samples)))
return
}