From 62bb21102f2f709f222fb6bd701cc32589700a91 Mon Sep 17 00:00:00 2001 From: Julian Labus Date: Thu, 30 Nov 2017 12:45:28 +0100 Subject: [PATCH] [TASK] add autoupdater to graphite database --- database/graphite/database.go | 9 +++++---- database/graphite/global.go | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/database/graphite/database.go b/database/graphite/database.go index a0bf9b4..bab9c06 100644 --- a/database/graphite/database.go +++ b/database/graphite/database.go @@ -9,10 +9,11 @@ import ( ) const ( - MeasurementNode = "node" // Measurement for per-node statistics - MeasurementGlobal = "global" // Measurement for summarized global statistics - CounterMeasurementFirmware = "firmware" // Measurement for firmware statistics - CounterMeasurementModel = "model" // Measurement for model statistics + MeasurementNode = "node" // Measurement for per-node statistics + MeasurementGlobal = "global" // Measurement for summarized global statistics + CounterMeasurementFirmware = "firmware" // Measurement for firmware statistics + CounterMeasurementModel = "model" // Measurement for model statistics + CounterMeasurementAutoupdater = "autoupdater" // Measurement for autoupdater ) type Connection struct { diff --git a/database/graphite/global.go b/database/graphite/global.go index 2c2bedb..acdd056 100644 --- a/database/graphite/global.go +++ b/database/graphite/global.go @@ -11,16 +11,19 @@ func (c *Connection) InsertGlobals(stats *runtime.GlobalStats, time time.Time, s measurementGlobal := MeasurementGlobal counterMeasurementModel := CounterMeasurementModel counterMeasurementFirmware := CounterMeasurementFirmware + counterMeasurementAutoupdater := CounterMeasurementAutoupdater if site != runtime.GLOBAL_SITE { measurementGlobal += "_" + site counterMeasurementModel += "_" + site counterMeasurementFirmware += "_" + site + counterMeasurementAutoupdater += "_" + site } c.addPoint(GlobalStatsFields(measurementGlobal, stats)) c.addCounterMap(counterMeasurementModel, stats.Models, time) c.addCounterMap(counterMeasurementFirmware, stats.Firmwares, time) + c.addCounterMap(counterMeasurementAutoupdater, stats.Autoupdater, time) } func GlobalStatsFields(name string, stats *runtime.GlobalStats) []graphigo.Metric {