Some collectors were missed when migrating to the local
github.com/prometheus-community/windows_exporter/log library.
Signed-off-by: Ben Reedy <breed808@breed808.com>
msmq collector would only collect from a hard-coded "Computer Queues"
queue.
Removal of filter allows other queues to be queried with
the collector.msmq.msmq-where flag.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Benchmarks will allow for easier identification of slow collectors.
Additionally, they increase test coverage of the collectors, with some
collectors now reaching 80-95% coverage with this change.
Collector benchmarks have been structed so that common functionality is
present in `collector/collector_test.go` as is done with non-test
functionality in `collector/collector.go`.
Test logic that is specific to individual collectors is present in the
collector test file (E.G. `collector/process_test.go` for the Process
collector).
Signed-off-by: Ben Reedy <breed808@breed808.com>
- Defer registry close calls
- Ensure size parameter in GetComputerName is properly specified
- Clean up some comments to ensure correctness
Signed-off-by: Ben Ridley <benridley29@gmail.com>
The cpu_info collector exposes a single metric per socket with some
information on installed CPUs, somewhat like the node_cpu_info metric
Signed-off-by: Steffen Higel <higels@valvesoftware.com>
Windows Server 2016 or newer is required for the collector, as the
perflib counters were not exposed in previous versions.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Instance label is conflicting with default Prometheus "instance" label
which is added when scraping targets.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Resolves issue where collector would always return a failure after an
inital failure, as the counter was not reset.
Signed-off-by: Ben Reedy <breed808@breed808.com>
DFSR collector now follow similar structure to the MSSQL collector,
where several 'child' collectors are run concurrently, depending on user
input from the `--collectors.dfsr.sources-enabled` flag.
Signed-off-by: Ben Reedy <breed808@breed808.com>
Using perflib is substantially faster and more reliable than using WMI to
retrieve Windows performance counter data.
Signed-off-by: Michael Allen <MAllen@laserfiche.com>
The old names were hard to read, but had to be named as such to work with
the WMI library. Now that raw performance counter data are used instead of
WMI, we are free to name the data structs freely.
Signed-off-by: Michael Allen <MAllen@laserfiche.com>