Skip to content
Snippets Groups Projects
Commit 7d8de4b8 authored by Nathan Haneysmith's avatar Nathan Haneysmith
Browse files

Move default ratelimit to init

parent ca49babf
No related branches found
No related tags found
No related merge requests found
......@@ -120,8 +120,6 @@ func (c *CloudWatch) Description() string {
}
func (c *CloudWatch) Gather(acc telegraf.Accumulator) error {
c.setDefaultValues()
if c.client == nil {
c.initializeCloudWatch()
}
......@@ -199,17 +197,12 @@ func (c *CloudWatch) Gather(acc telegraf.Accumulator) error {
return errChan.Error()
}
func (c *CloudWatch) setDefaultValues() {
if c.RateLimit == 0 {
c.RateLimit = 10
}
}
func init() {
inputs.Add("cloudwatch", func() telegraf.Input {
ttl, _ := time.ParseDuration("1hr")
return &CloudWatch{
CacheTTL: internal.Duration{Duration: ttl},
CacheTTL: internal.Duration{Duration: ttl},
RateLimit: 10,
}
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment