[TASK] add autoupdater to graphite database

This commit is contained in:
Julian Labus 2017-11-30 12:45:28 +01:00 committed by Geno
parent 7324567f91
commit 62bb21102f
2 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,7 @@ const (
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 {

View File

@ -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 {