Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
ca49babf
Commit
ca49babf
authored
8 years ago
by
Nathan Haneysmith
Browse files
Options
Downloads
Patches
Plain Diff
set a default value of 10 for ratelimit
parent
0589a1d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/inputs/cloudwatch/README.md
+1
-1
1 addition, 1 deletion
plugins/inputs/cloudwatch/README.md
plugins/inputs/cloudwatch/cloudwatch.go
+9
-1
9 additions, 1 deletion
plugins/inputs/cloudwatch/cloudwatch.go
with
10 additions
and
2 deletions
plugins/inputs/cloudwatch/README.md
+
1
−
1
View file @
ca49babf
...
...
@@ -36,7 +36,7 @@ API endpoint. In the following order the plugin will attempt to authenticate.
## Maximum requests per second. Note that the global default AWS rate limit is
## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
## maximum of 10.
## maximum of 10.
Optional - default value is 10.
ratelimit
=
10
## Metrics to Pull (optional)
...
...
This diff is collapsed.
Click to expand it.
plugins/inputs/cloudwatch/cloudwatch.go
+
9
−
1
View file @
ca49babf
...
...
@@ -99,7 +99,7 @@ func (c *CloudWatch) SampleConfig() string {
## Maximum requests per second. Note that the global default AWS rate limit is
## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
## maximum of 10.
## maximum of 10.
Optional - default value is 10.
ratelimit = 10
## Metrics to Pull (optional)
...
...
@@ -120,6 +120,8 @@ func (c *CloudWatch) Description() string {
}
func
(
c
*
CloudWatch
)
Gather
(
acc
telegraf
.
Accumulator
)
error
{
c
.
setDefaultValues
()
if
c
.
client
==
nil
{
c
.
initializeCloudWatch
()
}
...
...
@@ -197,6 +199,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"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment