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
b012713c
Commit
b012713c
authored
9 years ago
by
Cameron Sparr
Browse files
Options
Downloads
Patches
Plain Diff
Adding time_ prefix to all CPU time measurements
parent
82d91414
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+5
-1
5 additions, 1 deletion
CHANGELOG.md
agent.go
+7
-1
7 additions, 1 deletion
agent.go
plugins/system/CPU_README.md
+10
-10
10 additions, 10 deletions
plugins/system/CPU_README.md
plugins/system/cpu.go
+12
-10
12 additions, 10 deletions
plugins/system/cpu.go
with
34 additions
and
22 deletions
CHANGELOG.md
+
5
−
1
View file @
b012713c
...
...
@@ -3,9 +3,13 @@
### Release Notes
-
InfluxDB output config change:
`url`
is now
`urls`
, and is a list. Config files
will still be backwards compatible if only
`url`
is specified.
-
The -test flag will now output two metric collections
-
**Breaking Change**
: The CPU collection plugin has been refactored to fix some
bugs and outdated dependency issues. At the same time, I also decided to fix
a naming consistency issue, so cpu_percentageIdle will become cpu_usage_idle
a naming consistency issue, so cpu_percentageIdle will become cpu_usage_idle.
Also, all CPU time measurements now have it indicated in their name, so cp_idle
will become cpu_time_idle, additionally, these cpu_time measurements are going
to be dropped in the default config with a plugin drop parameter.
### Features
-
[
#143
](
https://github.com/influxdb/telegraf/issues/143
)
: InfluxDB clustering support
...
...
This diff is collapsed.
Click to expand it.
agent.go
+
7
−
1
View file @
b012713c
...
...
@@ -363,7 +363,7 @@ func (a *Agent) Test() error {
acc
.
Prefix
=
plugin
.
name
+
"_"
acc
.
Config
=
plugin
.
config
fmt
.
Printf
(
"* Plugin: %s
\n
"
,
plugin
.
name
)
fmt
.
Printf
(
"* Plugin: %s
Collection 1
\n
"
,
plugin
.
name
)
if
plugin
.
config
.
Interval
!=
0
{
fmt
.
Printf
(
"* Internal: %s
\n
"
,
plugin
.
config
.
Interval
)
}
...
...
@@ -371,6 +371,12 @@ func (a *Agent) Test() error {
if
err
:=
plugin
.
plugin
.
Gather
(
&
acc
);
err
!=
nil
{
return
err
}
time
.
Sleep
(
500
*
time
.
Millisecond
)
fmt
.
Printf
(
"* Plugin: %s Collection 2
\n
"
,
plugin
.
name
)
if
err
:=
plugin
.
plugin
.
Gather
(
&
acc
);
err
!=
nil
{
return
err
}
}
return
nil
...
...
This diff is collapsed.
Click to expand it.
plugins/system/CPU_README.md
+
10
−
10
View file @
b012713c
...
...
@@ -47,16 +47,16 @@ Meta:
-
tags:
`cpu=<cpuN> or <cpu-total>`
Measurement names:
-
cpu_user
-
cpu_system
-
cpu_idle
-
cpu_nice
-
cpu_iowait
-
cpu_irq
-
cpu_softirq
-
cpu_steal
-
cpu_guest
-
cpu_guest_nice
-
cpu_
time_
user
-
cpu_
time_
system
-
cpu_
time_
idle
-
cpu_
time_
nice
-
cpu_
time_
iowait
-
cpu_
time_
irq
-
cpu_
time_
softirq
-
cpu_
time_
steal
-
cpu_
time_
guest
-
cpu_
time_
guest_nice
### CPU Usage Percent Measurements:
...
...
This diff is collapsed.
Click to expand it.
plugins/system/cpu.go
+
12
−
10
View file @
b012713c
...
...
@@ -30,6 +30,8 @@ var sampleConfig = `
percpu = true
# Whether to report total system cpu stats or not
totalcpu = true
# Comment this line if you want the raw CPU time metrics
drop = ["cpu_time"]
`
func
(
_
*
CPUStats
)
SampleConfig
()
string
{
...
...
@@ -50,16 +52,16 @@ func (s *CPUStats) Gather(acc plugins.Accumulator) error {
total
:=
totalCpuTime
(
cts
)
// Add total cpu numbers
add
(
acc
,
"user"
,
cts
.
User
,
tags
)
add
(
acc
,
"system"
,
cts
.
System
,
tags
)
add
(
acc
,
"idle"
,
cts
.
Idle
,
tags
)
add
(
acc
,
"nice"
,
cts
.
Nice
,
tags
)
add
(
acc
,
"iowait"
,
cts
.
Iowait
,
tags
)
add
(
acc
,
"irq"
,
cts
.
Irq
,
tags
)
add
(
acc
,
"softirq"
,
cts
.
Softirq
,
tags
)
add
(
acc
,
"steal"
,
cts
.
Steal
,
tags
)
add
(
acc
,
"guest"
,
cts
.
Guest
,
tags
)
add
(
acc
,
"guest_nice"
,
cts
.
GuestNice
,
tags
)
add
(
acc
,
"
time_
user"
,
cts
.
User
,
tags
)
add
(
acc
,
"
time_
system"
,
cts
.
System
,
tags
)
add
(
acc
,
"
time_
idle"
,
cts
.
Idle
,
tags
)
add
(
acc
,
"
time_
nice"
,
cts
.
Nice
,
tags
)
add
(
acc
,
"
time_
iowait"
,
cts
.
Iowait
,
tags
)
add
(
acc
,
"
time_
irq"
,
cts
.
Irq
,
tags
)
add
(
acc
,
"
time_
softirq"
,
cts
.
Softirq
,
tags
)
add
(
acc
,
"
time_
steal"
,
cts
.
Steal
,
tags
)
add
(
acc
,
"
time_
guest"
,
cts
.
Guest
,
tags
)
add
(
acc
,
"
time_
guest_nice"
,
cts
.
GuestNice
,
tags
)
// Add in percentage
if
len
(
s
.
lastStats
)
==
0
{
...
...
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