From 8858facc9167bb478fd5f243ff0d261d0c31e09e Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Mon, 11 Sep 2017 07:44:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B1=B0=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=B2=B4=EB=84=90=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consumer/influx_stat.go | 2 +- main.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/consumer/influx_stat.go b/consumer/influx_stat.go index 8895c9f..2d7e1d3 100644 --- a/consumer/influx_stat.go +++ b/consumer/influx_stat.go @@ -9,7 +9,7 @@ import ( ) var ( - influxLogger = logger.NewLogger("consumer") + influxLogger = logger.NewLogger("influx") ) type influxMetric struct { diff --git a/main.go b/main.go index 19fd466..8247e0b 100644 --- a/main.go +++ b/main.go @@ -120,9 +120,6 @@ func main() { tempetureChannel = make(chan processor.TempetureInfo) fanspeedChannel = make(chan processor.FanspeedInfo) ) - defer close(tempetureChannel) - defer close(fanspeedChannel) - processors = make([]processor.Processor, 0, processorCount) for i := 0; i < processorCount; i++ { if info, err := processor.NewProcessorInfo(handler, i, sampleDuration, @@ -141,10 +138,15 @@ func main() { fanController := consumer.NewFanControl(processorCount, sampleDuration, handler) metricLogger := consumer.NewInfluxMetric("", processorCount, handler) + handler.IncreaseWait() go FanoutTempeture(tempetureChannel, handler, metricLogger.TempetureConsumer()) + defer close(tempetureChannel) + handler.IncreaseWait() go FanoutSpeed(fanspeedChannel, handler, fanController.Consumer(), metricLogger.FanSpeedConsumer()) + defer close(fanspeedChannel) + handler.IncreaseWait() go fanController.StartControl() handler.IncreaseWait()