address issue

This commit is contained in:
Cody Lee 2025-04-04 08:33:58 -05:00
parent 5122360018
commit 4b19b873ab
No known key found for this signature in database
5 changed files with 10 additions and 10 deletions

View File

@ -106,7 +106,7 @@ func (u *DatadogUnifi) setConfigDefaults() {
u.Interval = cnfg.Duration{Duration: minimumInterval}
}
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
u.options = make([]statsd.Option, 0)
@ -182,7 +182,7 @@ func (u *DatadogUnifi) DebugOutput() (bool, error) {
u.Statsd, err = statsd.New(u.Address, u.options...)
if err != nil {
return false, fmt.Errorf("Error configuration Datadog agent reporting: %+v", err)
return false, fmt.Errorf("error configuration Datadog agent reporting: %+v", err)
}
return true, nil

View File

@ -165,7 +165,7 @@ func (u *InfluxUnifi) DebugOutput() (bool, error) {
u.setConfigDefaults()
_, err := url.Parse(u.Config.URL)
_, err := url.Parse(u.URL)
if err != nil {
return false, fmt.Errorf("invalid influx URL: %v", err)
}
@ -223,7 +223,7 @@ func (u *InfluxUnifi) Run(c poller.Collect) error {
u.setConfigDefaults()
_, err = url.Parse(u.Config.URL)
_, err = url.Parse(u.URL)
if err != nil {
u.LogErrorf("invalid influx URL: %v", err)
@ -304,7 +304,7 @@ func (u *InfluxUnifi) setConfigDefaults() {
u.Interval = cnfg.Duration{Duration: minimumInterval}
}
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
}
func (u *InfluxUnifi) getPassFromFile(filename string) string {

View File

@ -56,7 +56,7 @@ func (u *UnifiPoller) Start() error {
}
log.Fatal("Failed debug checks")
return err
}
@ -88,7 +88,7 @@ func (f *Flags) Parse(args []string) {
// 3. Start a web server and wait for Prometheus to poll the application for metrics.
func (u *UnifiPoller) Run() error {
if u.Flags.DumpJSON != "" {
u.Config.Quiet = true
u.Quiet = true
if err := u.InitializeInputs(); err != nil {
return err
}

View File

@ -306,7 +306,7 @@ func (u *promUnifi) collect(ch chan<- prometheus.Metric, filter *poller.Filter)
r := &Report{
Config: u.Config,
ch: make(chan []*metric, u.Config.Buffer),
ch: make(chan []*metric, u.Buffer),
Start: time.Now(),
}
defer r.close()

View File

@ -176,7 +176,7 @@ func (w *webPlugins) newInputEvent(plugin, id string, event *Event) {
input.Events[id] = &EventGroup{}
}
input.Events[id].add(event, int(w.Config.MaxEvents))
input.Events[id].add(event, int(w.MaxEvents))
}
func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
@ -196,7 +196,7 @@ func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
output.Events[id] = &EventGroup{}
}
output.Events[id].add(event, int(w.Config.MaxEvents))
output.Events[id].add(event, int(w.MaxEvents))
}
func (w *webPlugins) newInput(config *Input) {