From 2672aa8ece5d50eec83b3a493cfe5b03c6b7a163 Mon Sep 17 00:00:00 2001 From: Bjoern Rabenstein Date: Wed, 12 Nov 2014 17:12:57 +0100 Subject: [PATCH] Instrument series maintenance. Change-Id: Ie4269d07ad4d23d44230c95a523088b472718e54 --- storage/local/instrumentation.go | 12 +++++++----- storage/local/storage.go | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/storage/local/instrumentation.go b/storage/local/instrumentation.go index 1c061b25b..0db846cd4 100644 --- a/storage/local/instrumentation.go +++ b/storage/local/instrumentation.go @@ -46,11 +46,13 @@ const ( opTypeLabel = "type" // Op-types for seriesOps. - create = "create" - archive = "archive" - unarchive = "unarchive" - memoryPurge = "purge_from_memory" - archivePurge = "purge_from_archive" + create = "create" + archive = "archive" + unarchive = "unarchive" + memoryPurge = "purge_from_memory" + archivePurge = "purge_from_archive" + memoryMaintenance = "maintenance_in_memory" + archiveMaintenance = "maintenance_in_archive" // Op-types for chunkOps. createAndPin = "create" // A chunkDesc creation with refCount=1. diff --git a/storage/local/storage.go b/storage/local/storage.go index c82e56e3b..a8862441f 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -580,8 +580,10 @@ loop: case fp := <-memoryFingerprints: s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter)) // TODO: Move chunkdesc eviction and archiving here. + s.seriesOps.WithLabelValues(memoryMaintenance).Inc() case fp := <-archivedFingerprints: s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter)) + s.seriesOps.WithLabelValues(archiveMaintenance).Inc() } } // Wait until both channels are closed.