Skip to content
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

Merged

Conversation

martinscholz83
Copy link
Contributor

Like discussed in #3828 this PR add a config option to ignore non existent counters.

@elasticmachine
Copy link
Collaborator

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 {

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) {

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 {

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) {

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 {

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) {

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

@kvch
Copy link
Contributor

kvch commented Feb 21, 2018

jenkins test it

@kvch kvch added review Metricbeat Metricbeat labels Feb 21, 2018
@ruflin
Copy link
Contributor

ruflin commented Feb 23, 2018

@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.

@ruflin ruflin requested a review from andrewkroh February 23, 2018 07:27
@kvch
Copy link
Contributor

kvch commented Feb 23, 2018

@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 {

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.

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.

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)

Copy link
Contributor

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.

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 ..."

@ruflin ruflin added the module label Feb 26, 2018

values, err := handle.Read()

time.Sleep(time.Millisecond * 1000)
Copy link
Contributor

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.

@ruflin
Copy link
Contributor

ruflin commented Mar 4, 2018

jenkins, test it

@krasekhi
Copy link

krasekhi commented Mar 5, 2018

Any chance this enhancement will make it in the 6.2.x or 6.3 release?

@andrewkroh
Copy link
Member

It looks like we have a build error with this:

module\windows\perfmon\pdh_integration_windows_test.go:110:12: undefined: PerfmonConfig

https://beats-ci.elastic.co/job/elastic+beats+pull-request+multijob-windows/3383/beat=metricbeat,label=windows/

@andrewkroh
Copy link
Member

andrewkroh commented Mar 8, 2018

@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 andrewkroh merged commit 75228cc into elastic:master Mar 9, 2018
@martinscholz83
Copy link
Contributor Author

@andrewkroh, thanks for the commit! Didn't had the time last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants