diff --git a/cc-metric-collector.go b/cc-metric-collector.go index 994edda..fc07c99 100644 --- a/cc-metric-collector.go +++ b/cc-metric-collector.go @@ -50,30 +50,6 @@ type RuntimeConfig struct { Sync sync.WaitGroup } -//// Structure of the configuration file -//type GlobalConfig struct { -// Sink sinks.SinkConfig `json:"sink"` -// Interval int `json:"interval"` -// Duration int `json:"duration"` -// Collectors []string `json:"collectors"` -// Receiver receivers.ReceiverConfig `json:"receiver"` -// DefTags map[string]string `json:"default_tags"` -// CollectConfigs map[string]json.RawMessage `json:"collect_config"` -//} - -//// Load JSON configuration file -//func LoadConfiguration(file string, config *GlobalConfig) error { -// configFile, err := os.Open(file) -// defer configFile.Close() -// if err != nil { -// fmt.Println(err.Error()) -// return err -// } -// jsonParser := json.NewDecoder(configFile) -// err = jsonParser.Decode(config) -// return err -//} - func ReadCli() map[string]string { var m map[string]string cfg := flag.String("config", "./config.json", "Path to configuration file") @@ -93,22 +69,6 @@ func ReadCli() map[string]string { return m } -//func SetLogging(logfile string) error { -// var file *os.File -// var err error -// if logfile != "stderr" { -// file, err = os.OpenFile(logfile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600) -// if err != nil { -// log.Fatal(err) -// return err -// } -// } else { -// file = os.Stderr -// } -// log.SetOutput(file) -// return nil -//} - // General shutdownHandler function that gets executed in case of interrupt or graceful shutdownHandler func shutdownHandler(config *RuntimeConfig, shutdownSignal chan os.Signal) { defer config.Sync.Done() @@ -216,11 +176,6 @@ func mainFunc() int { return 1 } - // Set log file - // if logfile := rcfg.CliArgs["logfile"]; logfile != "stderr" { - // cclog.SetOutput(logfile) - // } - // Creat new multi channel ticker rcfg.MultiChanTicker = mct.NewTicker(rcfg.Interval)