Skip to content

Commit

Permalink
Fix Metricbeat module debug statement (#4264)
Browse files Browse the repository at this point in the history
The "Stopped Wrapper" statement was logged at the wrong time.

    2017-05-09T09:35:52-04:00 DBG Starting Wrapper[name=system, len(metricSetWrappers)=3]
    2017-05-09T09:35:52-04:00 DBG Stopped Wrapper[name=system, len(metricSetWrappers)=3]
    2017-05-09T09:35:52-04:00 DBG Starting metricSetWrapper[module=system, name=cpu, host=]
    2017-05-09T09:35:52-04:00 DBG Starting metricSetWrapper[module=system, name=process, host=]
    2017-05-09T09:35:52-04:00 DBG Starting metricSetWrapper[module=system, name=memory, host=]
  • Loading branch information
andrewkroh authored and ruflin committed May 10, 2017
1 parent 770b78a commit 1cffd0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha1...master[Check the HEAD d
*Heartbeat*

*Metricbeat*
- Fix a debug statement that said a module wrapper had stopped when it hadn't. {pull}4264[4264]

*Packetbeat*

Expand Down Expand Up @@ -71,7 +72,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha1...master[Check the HEAD d

*Winlogbeat*

==== Knwon Issue
==== Known Issue


////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -192,7 +193,7 @@ https://github.com/elastic/beats/compare/v5.4.0...v6.0.0-alpha1[View commits]
*Winlogbeat*
==== Knwon Issue
==== Known Issue
*Filebeat*
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/mb/module/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func NewWrappers(modulesConfig []*common.Config, r *mb.Register) ([]*Wrapper, er
// Start should be called only once in the life of a Wrapper.
func (mw *Wrapper) Start(done <-chan struct{}) <-chan common.MapStr {
debugf("Starting %s", mw)
defer debugf("Stopped %s", mw)

out := make(chan common.MapStr, 1)

Expand All @@ -151,6 +150,7 @@ func (mw *Wrapper) Start(done <-chan struct{}) <-chan common.MapStr {
go func() {
wg.Wait()
close(out)
debugf("Stopped %s", mw)
}()

return out
Expand Down

0 comments on commit 1cffd0b

Please sign in to comment.