parent
d4bed35e7e
commit
d8d81b193f
|
@ -12,6 +12,7 @@
|
||||||
- [#788](https://github.com/influxdata/telegraf/pull/788): -input-list and -output-list command-line options. Thanks @ebookbug!
|
- [#788](https://github.com/influxdata/telegraf/pull/788): -input-list and -output-list command-line options. Thanks @ebookbug!
|
||||||
- [#778](https://github.com/influxdata/telegraf/pull/778): Adding a TCP input listener.
|
- [#778](https://github.com/influxdata/telegraf/pull/778): Adding a TCP input listener.
|
||||||
- [#797](https://github.com/influxdata/telegraf/issues/797): Provide option for persistent MQTT consumer client sessions.
|
- [#797](https://github.com/influxdata/telegraf/issues/797): Provide option for persistent MQTT consumer client sessions.
|
||||||
|
- [#799](https://github.com/influxdata/telegraf/pull/799): Add number of threads for procstat input plugin. Thanks @titilambert!
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- [#748](https://github.com/influxdata/telegraf/issues/748): Fix sensor plugin split on ":"
|
- [#748](https://github.com/influxdata/telegraf/issues/748): Fix sensor plugin split on ":"
|
||||||
|
|
|
@ -35,6 +35,10 @@ The above configuration would result in output like:
|
||||||
# Measurements
|
# Measurements
|
||||||
Note: prefix can be set by the user, per process.
|
Note: prefix can be set by the user, per process.
|
||||||
|
|
||||||
|
|
||||||
|
Threads related measurement names:
|
||||||
|
- procstat_[prefix_]num_threads value=5
|
||||||
|
|
||||||
File descriptor related measurement names:
|
File descriptor related measurement names:
|
||||||
- procstat_[prefix_]num_fds value=4
|
- procstat_[prefix_]num_fds value=4
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ func NewSpecProcessor(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *SpecProcessor) pushMetrics() {
|
func (p *SpecProcessor) pushMetrics() {
|
||||||
|
p.pushNThreadsStats()
|
||||||
p.pushFDStats()
|
p.pushFDStats()
|
||||||
p.pushCtxStats()
|
p.pushCtxStats()
|
||||||
p.pushIOStats()
|
p.pushIOStats()
|
||||||
|
@ -60,6 +61,15 @@ func (p *SpecProcessor) pushMetrics() {
|
||||||
p.flush()
|
p.flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *SpecProcessor) pushNThreadsStats() error {
|
||||||
|
numThreads, err := p.proc.NumThreads()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("NumThreads error: %s\n", err)
|
||||||
|
}
|
||||||
|
p.add("num_threads", numThreads)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (p *SpecProcessor) pushFDStats() error {
|
func (p *SpecProcessor) pushFDStats() error {
|
||||||
fds, err := p.proc.NumFDs()
|
fds, err := p.proc.NumFDs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue