influxdb2

This commit is contained in:
jiangyong 2024-01-21 18:52:22 +08:00
parent bc9c6c5ce3
commit 46882eb4ce
2 changed files with 2 additions and 11 deletions

View File

@ -14,8 +14,9 @@ type Config struct {
func NewConfg() *Config { func NewConfg() *Config {
return &Config{ return &Config{
Address: "10.0.1.15:17000", Address: "http://10.0.0.131:8086",
Interval: 10, Interval: 10,
Database: "telegraf",
} }
} }
@ -28,12 +29,3 @@ func Init(c *Config) error {
go serv.run() go serv.run()
return nil return nil
} }
func (c *Config) Default() {
if c.Database == "" {
c.Database = "telegraf"
}
if c.Interval == 0 {
c.Interval = 10
}
}

View File

@ -29,7 +29,6 @@ type service struct {
} }
func NewService(c *Config) *service { func NewService(c *Config) *service {
c.Default()
hostname, _ := os.Hostname() hostname, _ := os.Hostname()
infUrl, _ := url.Parse(c.Address) infUrl, _ := url.Parse(c.Address)