-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perfmon ignore non existent counters #6432
Perfmon ignore non existent counters #6432
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@@ -21,6 +21,11 @@ type CounterConfig struct { | |||
Format string `config:"format"` | |||
} | |||
|
|||
type PerfmonConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type PerfmonConfig should have comment or be unexported
type name will be used as perfmon.PerfmonConfig by other packages, and that stutters; consider calling this Config
@@ -314,7 +316,7 @@ type PerfmonReader struct { | |||
executed bool // Indicates if the query has been executed. | |||
} | |||
|
|||
func NewPerfmonReader(config []CounterConfig) (*PerfmonReader, error) { | |||
func NewPerfmonReader(config PerfmonConfig) (*PerfmonReader, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewPerfmonReader should have comment or be unexported
@@ -21,6 +21,11 @@ type CounterConfig struct { | |||
Format string `config:"format"` | |||
} | |||
|
|||
type PerfmonConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type PerfmonConfig should have comment or be unexported
type name will be used as perfmon.PerfmonConfig by other packages, and that stutters; consider calling this Config
@@ -314,7 +316,7 @@ type PerfmonReader struct { | |||
executed bool // Indicates if the query has been executed. | |||
} | |||
|
|||
func NewPerfmonReader(config []CounterConfig) (*PerfmonReader, error) { | |||
func NewPerfmonReader(config PerfmonConfig) (*PerfmonReader, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewPerfmonReader should have comment or be unexported
@@ -21,6 +21,11 @@ type CounterConfig struct { | |||
Format string `config:"format"` | |||
} | |||
|
|||
type PerfmonConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type PerfmonConfig should have comment or be unexported
type name will be used as perfmon.PerfmonConfig by other packages, and that stutters; consider calling this Config
@@ -314,7 +316,7 @@ type PerfmonReader struct { | |||
executed bool // Indicates if the query has been executed. | |||
} | |||
|
|||
func NewPerfmonReader(config []CounterConfig) (*PerfmonReader, error) { | |||
func NewPerfmonReader(config PerfmonConfig) (*PerfmonReader, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewPerfmonReader should have comment or be unexported
jenkins test it |
@martinscholz83 Thanks for the addition. Could you add a CHANGELOG and make HoundCI happy? The config name is pretty long but I don't have a better suggestion. |
@martinscholz83 Ignore the AppVeyor failure. We don't use it anymore. |
@@ -21,6 +22,12 @@ type CounterConfig struct { | |||
Format string `config:"format"` | |||
} | |||
|
|||
// Config for the windows perfmon metricset. | |||
type PerfmonConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type name will be used as perfmon.PerfmonConfig by other packages, and that stutters; consider calling this Config
@@ -21,6 +22,12 @@ type CounterConfig struct { | |||
Format string `config:"format"` | |||
} | |||
|
|||
// Config for the windows perfmon metricset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type PerfmonConfig should be of the form "PerfmonConfig ..." (with optional leading article)
@@ -13,6 +13,7 @@ import ( | |||
"github.com/elastic/beats/metricbeat/mb" | |||
) | |||
|
|||
// Config for perfmon counters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type CounterConfig should be of the form "CounterConfig ..." (with optional leading article)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think houndci has a point here :-)
@@ -314,7 +316,8 @@ type PerfmonReader struct { | |||
executed bool // Indicates if the query has been executed. | |||
} | |||
|
|||
func NewPerfmonReader(config []CounterConfig) (*PerfmonReader, error) { | |||
// Creates a new instance of PerfmonReader. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function NewPerfmonReader should be of the form "NewPerfmonReader ..."
|
||
values, err := handle.Read() | ||
|
||
time.Sleep(time.Millisecond * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other way instead of using Sleep
here? It makes the test suite much slower and has always potential to break.
jenkins, test it |
Any chance this enhancement will make it in the 6.2.x or 6.3 release? |
It looks like we have a build error with this:
|
@krasekhi Since this is new feature it will likely make it into 6.3 rather than a 6.2 patch release. Once it merges into master would you be up for testing the feature using one of our snapshot releases? Those artifacts are updated after every commit to master. After you test it please drop a message here (good or bad, any feedback helps). Thanks |
@andrewkroh, thanks for the commit! Didn't had the time last week. |
Like discussed in #3828 this PR add a config option to ignore non existent counters.