mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-08 14:35:55 +02:00
Remove double error printing and return if measurements do not work
This commit is contained in:
parent
dc18714d83
commit
583faacd91
@ -384,15 +384,13 @@ func (m *LikwidCollector) takeMeasurement(group int, interval time.Duration) err
|
||||
ret = C.perfmon_setupCounters(gid)
|
||||
if ret != 0 {
|
||||
gctr := C.GoString(C.perfmon_getGroupName(gid))
|
||||
err := fmt.Errorf("failed to setup performance group %s", gctr)
|
||||
cclog.ComponentError(m.name, err.Error())
|
||||
err := fmt.Errorf("failed to setup performance group %d (%s)", gid, gctr)
|
||||
return err
|
||||
}
|
||||
ret = C.perfmon_startCounters()
|
||||
if ret != 0 {
|
||||
gctr := C.GoString(C.perfmon_getGroupName(gid))
|
||||
err := fmt.Errorf("failed to start performance group %s", gctr)
|
||||
cclog.ComponentError(m.name, err.Error())
|
||||
err := fmt.Errorf("failed to start performance group %d (%s)", gid, gctr)
|
||||
return err
|
||||
}
|
||||
m.running = true
|
||||
@ -401,8 +399,7 @@ func (m *LikwidCollector) takeMeasurement(group int, interval time.Duration) err
|
||||
ret = C.perfmon_stopCounters()
|
||||
if ret != 0 {
|
||||
gctr := C.GoString(C.perfmon_getGroupName(gid))
|
||||
err := fmt.Errorf("failed to stop performance group %s", gctr)
|
||||
cclog.ComponentError(m.name, err.Error())
|
||||
err := fmt.Errorf("failed to stop performance group %d (%s)", gid, gctr)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -533,7 +530,7 @@ func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric)
|
||||
err := m.takeMeasurement(i, interval)
|
||||
if err != nil {
|
||||
cclog.ComponentError(m.name, err.Error())
|
||||
continue
|
||||
return
|
||||
}
|
||||
// read measurements and derive event set metrics
|
||||
m.calcEventsetMetrics(i, interval, output)
|
||||
|
Loading…
x
Reference in New Issue
Block a user