Merge remote-tracking branch 'upstream/master'

This commit is contained in:
subhachandrachandra 2015-09-30 17:02:58 -07:00
commit 29363794c1
5 changed files with 20 additions and 7 deletions

View File

@ -9,9 +9,13 @@
- [#90](https://github.com/influxdb/telegraf/issues/90): Add Docker labels to tags in docker plugin
- [#223](https://github.com/influxdb/telegraf/pull/223): Add port tag to nginx plugin. Thanks @neezgee!
- [#227](https://github.com/influxdb/telegraf/pull/227): Add command intervals to exec plugin. Thanks @jpalay!
- Memory plugin: cached and buffered measurements re-added
- Logging: additional logging for each collection interval, track the number
of metrics collected and from how many plugins.
### Bugfixes
- [#228](https://github.com/influxdb/telegraf/pull/228): New version of package will replace old one. Thanks @ekini!
- [#232](https://github.com/influxdb/telegraf/pull/232): Fix bashism run during deb package installation. Thanks @yankcrime!
## v0.1.9 [2015-09-22]

View File

@ -177,12 +177,15 @@ func (a *Agent) crankParallel() error {
var wg sync.WaitGroup
start := time.Now()
counter := 0
for _, plugin := range a.plugins {
if plugin.config.Interval != 0 {
continue
}
wg.Add(1)
counter++
go func(plugin *runningPlugin) {
defer wg.Done()
@ -216,6 +219,9 @@ func (a *Agent) crankParallel() error {
bp.Points = append(bp.Points, sub.Points...)
}
elapsed := time.Since(start)
log.Printf("Cranking default (%s) interval, gathered %d metrics from %d plugins in %s\n",
a.Interval, len(bp.Points), counter, elapsed)
return a.flush(&bp)
}
@ -252,6 +258,7 @@ func (a *Agent) crankSeparate(shutdown chan struct{}, plugin *runningPlugin) err
for {
var bp BatchPoints
var outerr error
start := time.Now()
bp.Debug = a.Debug
@ -270,6 +277,9 @@ func (a *Agent) crankSeparate(shutdown chan struct{}, plugin *runningPlugin) err
bp.Time = bp.Time.UTC()
}
elapsed := time.Since(start)
log.Printf("Cranking separate (%s) interval, gathered %d metrics from %s in %s\n",
plugin.config.Interval, len(bp.Points), plugin.name, elapsed)
if err := a.flush(&bp); err != nil {
outerr = errors.New("Error encountered processing plugins & outputs")
}

View File

@ -132,12 +132,9 @@ func main() {
log.Printf("Starting Telegraf (version %s)\n", Version)
log.Printf("Loaded outputs: %s", strings.Join(outputs, " "))
log.Printf("Loaded plugins: %s", strings.Join(plugins, " "))
if ag.Debug {
log.Printf("Debug: enabled")
log.Printf("Agent Config: Interval:%s, Debug:%#v, Hostname:%#v, "+
"Precision:%#v, UTC: %#v\n",
ag.Interval, ag.Debug, ag.Hostname, ag.Precision, ag.UTC)
}
log.Printf("Tags enabled: %s", config.ListTags())
if *fPidfile != "" {

View File

@ -28,6 +28,8 @@ func (s *MemStats) Gather(acc plugins.Accumulator) error {
acc.Add("available", vm.Available, vmtags)
acc.Add("used", vm.Used, vmtags)
acc.Add("free", vm.Free, vmtags)
acc.Add("cached", vm.Cached, vmtags)
acc.Add("buffered", vm.Buffers, vmtags)
acc.Add("used_percent", 100*float64(vm.Used)/float64(vm.Total), vmtags)
acc.Add("available_percent",
100*float64(vm.Available)/float64(vm.Total),

View File

@ -149,7 +149,7 @@ ln -sfn $INSTALL_ROOT_DIR/versions/$version/telegraf $INSTALL_ROOT_DIR/telegraf
if ! id telegraf >/dev/null 2>&1; then
useradd --help 2>&1| grep -- --system > /dev/null 2>&1
old_useradd=\$?
if [[ \$old_useradd == 0 ]]
if [ \$old_useradd -eq 0 ]
then
useradd --system -U -M telegraf
else