Skip to content

Commit

Permalink
Improve procstat
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Mar 6, 2016
1 parent 35f1e28 commit efc48bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/inputs/procstat/spec_processor.go
Expand Up @@ -52,6 +52,7 @@ func NewSpecProcessor(
}

func (p *SpecProcessor) pushMetrics() {
p.pushNThreadsStats()
p.pushFDStats()
p.pushCtxStats()
p.pushIOStats()
Expand All @@ -60,6 +61,15 @@ func (p *SpecProcessor) pushMetrics() {
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 {
fds, err := p.proc.NumFDs()
if err != nil {
Expand Down

0 comments on commit efc48bd

Please sign in to comment.