-
Notifications
You must be signed in to change notification settings - Fork 708
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
Add a collector generator script #28
Conversation
very cool! I been meaning to learn "go generate", looks like i should study your impl. :) minor nitpick comment, otherwise lets merge and continue improve upon. |
} | ConvertTo-Json | ||
$outFileName = "..\..\collector\$CollectorName.go".ToLower() | ||
$input | .\collector-generator.exe | Out-File -NoClobber -Encoding UTF8 $outFileName | ||
go fmt $outFileName |
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.
nitpick: text files should end with a new line
) | ||
{{ end }} | ||
return nil, nil | ||
} |
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.
nitpick: text files should end with a new line
Actually, this doesn't use |
You're right of course. I commented before properly reading the code. |
I had heard about it but it didn't cross my mind when doing this. I'll check it out some day, it is probably a better solution |
10425ef
to
c0b133d
Compare
Fixed and squashed! |
great work! |
There is a fair amount of boilerplate involved in creating a new collector, so I've attempted to automate that part. This PR adds a script which queries a WMI class to pull its member list, and then creates a skeleton collector implementation.
One potential improvement would be if we could get the CounterType from the WMI query as well, then it would be possible to make a better guess on what type of metric should be exposed. Right now it is hardcoded to
GaugeValue
.It doesn't really fix #12, but it at least removes some of the tedium...