mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-20 19:49:03 +02:00
collector: publish base units and _total counter names (#2743)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -202,7 +202,7 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error {
|
||||
nil,
|
||||
)
|
||||
c.cpuTimeTotal = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_total"),
|
||||
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_seconds_total"),
|
||||
"Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user).",
|
||||
[]string{"process", "process_id", "mode"},
|
||||
nil,
|
||||
|
||||
@@ -68,7 +68,7 @@ func TestCollectorCurrentProcess(t *testing.T) {
|
||||
require.Positive(t, testutils.MetricValuesByLabel(families, name, "process_id")[pid], name)
|
||||
}
|
||||
|
||||
cpu := families["windows_process_cpu_time_total"].GetMetric()
|
||||
cpu := families["windows_process_cpu_time_seconds_total"].GetMetric()
|
||||
require.Len(t, cpu, 2)
|
||||
require.NotNil(t, cpu[0].GetCounter())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user