mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 12:37:25 +01:00
Cleanup
This commit is contained in:
parent
69b31e87e7
commit
2031f35d9b
@ -263,7 +263,7 @@ func (r *metricRouter) Start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foward message received from receivers channel
|
// Forward message received from receivers channel
|
||||||
recv_forward := func(p lp.CCMetric) {
|
recv_forward := func(p lp.CCMetric) {
|
||||||
// receive from receive manager
|
// receive from receive manager
|
||||||
if r.config.IntervalStamp {
|
if r.config.IntervalStamp {
|
||||||
@ -274,7 +274,7 @@ func (r *metricRouter) Start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foward message received from cache channel
|
// Forward message received from cache channel
|
||||||
cache_forward := func(p lp.CCMetric) {
|
cache_forward := func(p lp.CCMetric) {
|
||||||
// receive from metric collector
|
// receive from metric collector
|
||||||
if !r.dropMetric(p) {
|
if !r.dropMetric(p) {
|
||||||
@ -342,13 +342,18 @@ func (r *metricRouter) Close() {
|
|||||||
r.done <- true
|
r.done <- true
|
||||||
// wait for close of channel r.done
|
// wait for close of channel r.done
|
||||||
<-r.done
|
<-r.done
|
||||||
|
|
||||||
|
// stop timer
|
||||||
if r.config.IntervalStamp {
|
if r.config.IntervalStamp {
|
||||||
cclog.ComponentDebug("MetricRouter", "TIMER CLOSE")
|
cclog.ComponentDebug("MetricRouter", "TIMER CLOSE")
|
||||||
r.timerdone <- true
|
r.timerdone <- true
|
||||||
// wait for close of channel r.timerdone
|
// wait for close of channel r.timerdone
|
||||||
<-r.timerdone
|
<-r.timerdone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stop metric cache
|
||||||
if r.config.NumCacheIntervals > 0 {
|
if r.config.NumCacheIntervals > 0 {
|
||||||
|
cclog.ComponentDebug("MetricRouter", "CACHE CLOSE")
|
||||||
r.cache.Close()
|
r.cache.Close()
|
||||||
r.cachewg.Wait()
|
r.cachewg.Wait()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user