1
0
Fork 0

로거 이름 변경

체널 종료위치 변경
This commit is contained in:
Sangbum Kim 2017-09-11 07:44:30 +09:00
parent c784010593
commit 8858facc91
2 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import (
)
var (
influxLogger = logger.NewLogger("consumer")
influxLogger = logger.NewLogger("influx")
)
type influxMetric struct {

View File

@ -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()