Cast collector measurement duration to seconds. Thanks to KIT

This commit is contained in:
Thomas Roehl 2022-01-06 15:25:51 +01:00
parent 15cf16b46f
commit 43a8ea683d
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ func (m *LikwidCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
res := C.perfmon_getLastResult(gid, eidx, C.int(tid))
m.results[i][tid][gctr] = float64(res)
}
m.results[i][tid]["time"] = float64(interval)
m.results[i][tid]["time"] = interval.Seconds()
m.results[i][tid]["inverseClock"] = float64(1.0 / m.basefreq)
for _, metric := range evset.Metrics {
expression, err := govaluate.NewEvaluableExpression(metric.Calc)

View File

@ -281,7 +281,7 @@ func main() {
// storage locations
for _, c := range config.Collectors {
col := Collectors[c]
col.Read(time.Duration(config.Duration), &tmpPoints)
col.Read(time.Duration(config.Duration)*time.Second, &tmpPoints)
for {
if len(tmpPoints) == 0 {