mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-01 08:06:38 +00:00
process: negative values with windows_process_start_time (#1857)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@@ -134,10 +135,19 @@ func (c *Collector) collectWorkerV2() {
|
||||
name, pidString, parentPID, strconv.Itoa(int(processGroupID)), processOwner, cmdLine,
|
||||
)
|
||||
|
||||
startTime := float64(time.Now().Unix() - int64(data.ElapsedTime))
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.startTimeOld,
|
||||
prometheus.GaugeValue,
|
||||
startTime,
|
||||
name, pidString,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.startTime,
|
||||
prometheus.GaugeValue,
|
||||
data.ElapsedTime,
|
||||
startTime,
|
||||
name, pidString,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user