Use consistent metric name convention

This commit is contained in:
Alan Bernstein 2020-04-03 01:04:11 -05:00 committed by Matt Jaffee
parent 70111b5604
commit b1adcd91fc
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
3 changed files with 40 additions and 41 deletions

View file

@ -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(MetricSnapshot, elapsed.Seconds(), 1.0)
stats.Histogram(MetricSnapshotDuration, elapsed.Seconds(), 1.0)
}
// snapshot does the actual snapshot operation. it does not check or care

View file

@ -801,10 +801,10 @@ func (s *holderSyncer) SyncHolder() error {
}
}
}
s.Stats.Histogram(MetricSyncField, float64(time.Since(tf)), 1.0)
s.Stats.Histogram(MetricSyncFieldDuration, float64(time.Since(tf)), 1.0)
tf = time.Now() // reset tf
}
s.Stats.Histogram(MetricSyncIndex, float64(time.Since(ti)), 1.0)
s.Stats.Histogram(MetricSyncIndexDuration, float64(time.Since(ti)), 1.0)
ti = time.Now() // reset ti
}

View file

@ -1,48 +1,47 @@
package pilosa
const (
MetricCreateIndex = "createIndex"
MetricDeleteIndex = "deleteIndex"
MetricCreateField = "createField"
MetricDeleteField = "deleteField"
MetricDeleteAvailableShard = "deleteAvailableShard"
MetricRecalculateCache = "cache.recalculate"
MetricInvalidateCache = "cache.invalidate"
MetricRankCacheLength = "RankCache"
MetricCacheThresholdReached = "cache.threshold"
MetricRow = "range"
MetricRowBSI = "range:bsigroup"
MetricSetRowAttrs = "SetRowAttrs"
MetricSetProfileAttrs = "SetProfileAttrs"
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_set_row_attrs_total"
MetricSetProfileAttrs = "query_set_profile_attrs_total"
MetricMaximumRow = "maximum_row"
MetricSetBit = "setBit"
MetricRows = "rows"
MetricClearBit = "clearBit"
MetricSetRow = "setRow"
MetricClearRow = "clearRow"
MetricImportingN = "ImportingN"
MetricImportedN = "ImportedN"
MetricClearingN = "ClearingN"
MetricClearedN = "ClearedN"
MetricSnapshot = "snapshot"
MetricBlockRepairPrimary = "BlockRepairPrimary"
MetricBlockRepair = "BlockRepair"
MetricSyncField = "syncField"
MetricSyncIndex = "syncIndex"
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"
MetricBlockRepairPrimary = "block_repair_primary_total"
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"
MetricMaxShard = "maxShard"
MetricAntiEntropy = "AntiEntropy"
MetricAntiEntropyDuration = "AntiEntropyDuration"
MetricGarbageCollection = "garbage_collection"
MetricHttpRequest = "http_request_total"
MetricMaxShard = "maximum_shard"
MetricAntiEntropy = "antientropy_total"
MetricAntiEntropyDuration = "antientropy_duration_seconds"
MetricGarbageCollection = "garbage_collection_total"
MetricGoroutines = "goroutines"
MetricOpenFiles = "OpenFiles"
MetricHeapAlloc = "HeapAlloc"
MetricHeapInuse = "HeapInuse"
MetricStackInuse = "StackInuse"
MetricMallocs = "Mallocs"
MetricFrees = "Frees"
MetricOpenFiles = "open_files"
MetricHeapAlloc = "heap_alloc"
MetricHeapInuse = "heap_inuse"
MetricStackInuse = "stack_inuse"
MetricMallocs = "mallocs"
MetricFrees = "frees"
)