mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
Update some metric names to follow conventions better
This commit is contained in:
parent
f883d61c28
commit
2423ecf8d5
6 changed files with 51 additions and 51 deletions
|
|
@ -2249,7 +2249,7 @@ func (f *fragment) Snapshot() error {
|
|||
func track(start time.Time, message string, stats stats.StatsClient, logger logger.Logger) {
|
||||
elapsed := time.Since(start)
|
||||
logger.Debugf("%s took %s", message, elapsed)
|
||||
stats.Histogram(MetricSnapshotDuration, elapsed.Seconds(), 1.0)
|
||||
stats.Histogram(MetricSnapshotDurationSeconds, elapsed.Seconds(), 1.0)
|
||||
}
|
||||
|
||||
// snapshot does the actual snapshot operation. it does not check or care
|
||||
|
|
|
|||
|
|
@ -801,10 +801,10 @@ func (s *holderSyncer) SyncHolder() error {
|
|||
}
|
||||
}
|
||||
}
|
||||
s.Stats.Histogram(MetricSyncFieldDuration, float64(time.Since(tf)), 1.0)
|
||||
s.Stats.Histogram(MetricSyncFieldDurationSeconds, float64(time.Since(tf)), 1.0)
|
||||
tf = time.Now() // reset tf
|
||||
}
|
||||
s.Stats.Histogram(MetricSyncIndexDuration, float64(time.Since(ti)), 1.0)
|
||||
s.Stats.Histogram(MetricSyncIndexDurationSeconds, float64(time.Since(ti)), 1.0)
|
||||
ti = time.Now() // reset ti
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ func (h *Handler) collectStats(next http.Handler) http.Handler {
|
|||
|
||||
stats := h.api.StatsWithTags(statsTags)
|
||||
if stats != nil {
|
||||
stats.Timing(pilosa.MetricHttpRequest, dur, 0.1)
|
||||
stats.Timing(pilosa.MetricHTTPRequest, dur, 0.1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
84
metrics.go
84
metrics.go
|
|
@ -15,46 +15,46 @@
|
|||
package pilosa
|
||||
|
||||
const (
|
||||
MetricCreateIndex = "create_index_total"
|
||||
MetricDeleteIndex = "delete_index_total"
|
||||
MetricCreateField = "create_field_total"
|
||||
MetricDeleteField = "delete_field_total"
|
||||
MetricDeleteAvailableShard = "delete_available_shard_total"
|
||||
MetricRecalculateCache = "recalculate_cache_total"
|
||||
MetricInvalidateCache = "invalidate_cache_total"
|
||||
MetricRankCacheLength = "rank_cache_length"
|
||||
MetricCacheThresholdReached = "cache_threshold_reached_total"
|
||||
MetricRow = "query_row_total"
|
||||
MetricRowBSI = "query_row_bsi_total"
|
||||
MetricSetRowAttrs = "query_setrowattrs_total"
|
||||
MetricSetColumnAttrs = "query_setcolumnattrs_total"
|
||||
MetricMaximumRow = "maximum_row"
|
||||
MetricSetBit = "set_bit_total"
|
||||
MetricClearBit = "clear_bit_total"
|
||||
MetricSetRow = "set_row_total"
|
||||
MetricClearRow = "clear_row_total"
|
||||
MetricImportingN = "importing_total"
|
||||
MetricImportedN = "imported_total"
|
||||
MetricClearingN = "clearing_total"
|
||||
MetricClearedN = "cleared_total"
|
||||
MetricSnapshotDuration = "snapshot_duration_seconds"
|
||||
MetricBlockRepair = "block_repair_total"
|
||||
MetricSyncFieldDuration = "sync_field_duration_seconds"
|
||||
MetricSyncIndexDuration = "sync_index_duration_seconds"
|
||||
MetricColumnAttrStoreBlocks = "ColumnAttrStoreBlocks"
|
||||
MetricColumnAttrDiff = "ColumnAttrDiff"
|
||||
MetricRowAttrStoreBlocks = "RowAttrStoreBlocks"
|
||||
MetricRowAttrDiff = "RowAttrDiff"
|
||||
MetricHttpRequest = "http_request_total"
|
||||
MetricMaxShard = "maximum_shard"
|
||||
MetricAntiEntropy = "antientropy_total"
|
||||
MetricAntiEntropyDuration = "antientropy_duration_seconds"
|
||||
MetricGarbageCollection = "garbage_collection_total"
|
||||
MetricGoroutines = "goroutines"
|
||||
MetricOpenFiles = "open_files"
|
||||
MetricHeapAlloc = "heap_alloc"
|
||||
MetricHeapInuse = "heap_inuse"
|
||||
MetricStackInuse = "stack_inuse"
|
||||
MetricMallocs = "mallocs"
|
||||
MetricFrees = "frees"
|
||||
MetricCreateIndex = "create_index_total"
|
||||
MetricDeleteIndex = "delete_index_total"
|
||||
MetricCreateField = "create_field_total"
|
||||
MetricDeleteField = "delete_field_total"
|
||||
MetricDeleteAvailableShard = "delete_available_shard_total"
|
||||
MetricRecalculateCache = "recalculate_cache_total"
|
||||
MetricInvalidateCache = "invalidate_cache_total"
|
||||
MetricRankCacheLength = "rank_cache_length"
|
||||
MetricCacheThresholdReached = "cache_threshold_reached_total"
|
||||
MetricRow = "query_row_total"
|
||||
MetricRowBSI = "query_row_bsi_total"
|
||||
MetricSetRowAttrs = "query_setrowattrs_total"
|
||||
MetricSetColumnAttrs = "query_setcolumnattrs_total"
|
||||
MetricMaximumRow = "maximum_row"
|
||||
MetricSetBit = "set_bit_total"
|
||||
MetricClearBit = "clear_bit_total"
|
||||
MetricSetRow = "set_row_total"
|
||||
MetricClearRow = "clear_row_total"
|
||||
MetricImportingN = "importing_total"
|
||||
MetricImportedN = "imported_total"
|
||||
MetricClearingN = "clearing_total"
|
||||
MetricClearedN = "cleared_total"
|
||||
MetricSnapshotDurationSeconds = "snapshot_duration_seconds"
|
||||
MetricBlockRepair = "block_repair_total"
|
||||
MetricSyncFieldDurationSeconds = "sync_field_duration_seconds"
|
||||
MetricSyncIndexDurationSeconds = "sync_index_duration_seconds"
|
||||
MetricColumnAttrStoreBlocks = "ColumnAttrStoreBlocks"
|
||||
MetricColumnAttrDiff = "ColumnAttrDiff"
|
||||
MetricRowAttrStoreBlocks = "RowAttrStoreBlocks"
|
||||
MetricRowAttrDiff = "RowAttrDiff"
|
||||
MetricHTTPRequest = "http_request_total"
|
||||
MetricMaxShard = "maximum_shard"
|
||||
MetricAntiEntropy = "antientropy_total"
|
||||
MetricAntiEntropyDurationSeconds = "antientropy_duration_seconds"
|
||||
MetricGarbageCollection = "garbage_collection_total"
|
||||
MetricGoroutines = "goroutines"
|
||||
MetricOpenFiles = "open_files"
|
||||
MetricHeapAlloc = "heap_alloc"
|
||||
MetricHeapInuse = "heap_inuse"
|
||||
MetricStackInuse = "stack_inuse"
|
||||
MetricMallocs = "mallocs"
|
||||
MetricFrees = "frees"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -675,7 +675,7 @@ func (s *Server) monitorAntiEntropy() {
|
|||
// Record successful sync in log.
|
||||
s.logger.Printf("holder sync complete")
|
||||
dif := time.Since(t)
|
||||
s.holder.Stats.Histogram(MetricAntiEntropyDuration, float64(dif), 1.0)
|
||||
s.holder.Stats.Histogram(MetricAntiEntropyDurationSeconds, float64(dif), 1.0)
|
||||
|
||||
// Drain tick channel since we just finished anti-entropy. If the AE
|
||||
// process took a long time, we don't want them to pile up on each
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func TestStatsCount_TopN(t *testing.T) {
|
|||
}
|
||||
|
||||
if tags[0] != "index:d" {
|
||||
t.Errorf("Expected db, Results %s", tags[0])
|
||||
t.Errorf("Expected index, Results %s", tags[0])
|
||||
}
|
||||
|
||||
called = true
|
||||
|
|
@ -138,7 +138,7 @@ func TestStatsCount_Bitmap(t *testing.T) {
|
|||
}
|
||||
|
||||
if tags[0] != "index:d" {
|
||||
t.Errorf("Expected db, Results %s", tags[0])
|
||||
t.Errorf("Expected index, Results %s", tags[0])
|
||||
}
|
||||
|
||||
called = true
|
||||
|
|
@ -173,7 +173,7 @@ func TestStatsCount_SetRowAttrsBulk(t *testing.T) {
|
|||
}
|
||||
|
||||
if tags[0] != "index:d" {
|
||||
t.Errorf("Expected db, Results %s", tags[0])
|
||||
t.Errorf("Expected index, Results %s", tags[0])
|
||||
}
|
||||
called = true
|
||||
},
|
||||
|
|
@ -207,7 +207,7 @@ func TestStatsCount_SetColumnAttrs(t *testing.T) {
|
|||
}
|
||||
|
||||
if tags[0] != "index:d" {
|
||||
t.Errorf("Expected db, Results %s", tags[0])
|
||||
t.Errorf("Expected index, Results %s", tags[0])
|
||||
}
|
||||
called = true
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue