Instrument series maintenance.

Change-Id: Ie4269d07ad4d23d44230c95a523088b472718e54
This commit is contained in:
Bjoern Rabenstein 2014-11-12 17:12:57 +01:00
parent 371445f4da
commit 2672aa8ece
2 changed files with 9 additions and 5 deletions

View file

@ -46,11 +46,13 @@ const (
opTypeLabel = "type" opTypeLabel = "type"
// Op-types for seriesOps. // Op-types for seriesOps.
create = "create" create = "create"
archive = "archive" archive = "archive"
unarchive = "unarchive" unarchive = "unarchive"
memoryPurge = "purge_from_memory" memoryPurge = "purge_from_memory"
archivePurge = "purge_from_archive" archivePurge = "purge_from_archive"
memoryMaintenance = "maintenance_in_memory"
archiveMaintenance = "maintenance_in_archive"
// Op-types for chunkOps. // Op-types for chunkOps.
createAndPin = "create" // A chunkDesc creation with refCount=1. createAndPin = "create" // A chunkDesc creation with refCount=1.

View file

@ -580,8 +580,10 @@ loop:
case fp := <-memoryFingerprints: case fp := <-memoryFingerprints:
s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter)) s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter))
// TODO: Move chunkdesc eviction and archiving here. // TODO: Move chunkdesc eviction and archiving here.
s.seriesOps.WithLabelValues(memoryMaintenance).Inc()
case fp := <-archivedFingerprints: case fp := <-archivedFingerprints:
s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter)) s.purgeSeries(fp, clientmodel.TimestampFromTime(time.Now()).Add(-1*s.purgeAfter))
s.seriesOps.WithLabelValues(archiveMaintenance).Inc()
} }
} }
// Wait until both channels are closed. // Wait until both channels are closed.