Refactor cpu collector to use perflib instead of WMI.

This commit is contained in:
Calle Pettersson
2019-04-05 15:59:40 +02:00
parent 462a136673
commit 33879449a2
42 changed files with 1681 additions and 234 deletions

View File

@@ -1,4 +1,4 @@
// +build windows
// +build windows,cgo
package collector
@@ -131,7 +131,7 @@ func NewContainerMetricsCollector() (Collector, error) {
// Collect sends the metric values for each metric
// to the provided prometheus Metric channel.
func (c *ContainerMetricsCollector) Collect(ch chan<- prometheus.Metric) error {
func (c *ContainerMetricsCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) error {
if desc, err := c.collect(ch); err != nil {
log.Error("failed collecting ContainerMetricsCollector metrics:", desc, err)
return err