From 46882eb4cec663e32491d88ebd4cb677038206ea Mon Sep 17 00:00:00 2001 From: jiangyong Date: Sun, 21 Jan 2024 18:52:22 +0800 Subject: [PATCH] influxdb2 --- metric/config.go | 12 ++---------- metric/service.go | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/metric/config.go b/metric/config.go index 033ab96..2b88581 100644 --- a/metric/config.go +++ b/metric/config.go @@ -14,8 +14,9 @@ type Config struct { func NewConfg() *Config { return &Config{ - Address: "10.0.1.15:17000", + Address: "http://10.0.0.131:8086", Interval: 10, + Database: "telegraf", } } @@ -28,12 +29,3 @@ func Init(c *Config) error { go serv.run() return nil } - -func (c *Config) Default() { - if c.Database == "" { - c.Database = "telegraf" - } - if c.Interval == 0 { - c.Interval = 10 - } -} diff --git a/metric/service.go b/metric/service.go index 2a876bd..935a2f7 100644 --- a/metric/service.go +++ b/metric/service.go @@ -29,7 +29,6 @@ type service struct { } func NewService(c *Config) *service { - c.Default() hostname, _ := os.Hostname() infUrl, _ := url.Parse(c.Address)