mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 16:46:35 +00:00
logicaldisk: fix base counter values (#1747)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -404,7 +404,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
|||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.totalSpace,
|
c.totalSpace,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
volume[percentFreeSpace].FirstValue*1024*1024,
|
volume[percentFreeSpace].SecondValue*1024*1024,
|
||||||
name,
|
name,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ func (c *Collector) collectAccessMethodsInstance(ch chan<- prometheus.Metric, sq
|
|||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.accessMethodsWorktablesFromCacheLookups,
|
c.accessMethodsWorktablesFromCacheLookups,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
data[accessMethodsWorktablesFromCacheRatioBase].FirstValue,
|
data[accessMethodsWorktablesFromCacheRatioBase].SecondValue,
|
||||||
sqlInstance,
|
sqlInstance,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ func (c *Collector) collectBufferManagerInstance(ch chan<- prometheus.Metric, sq
|
|||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.bufManBuffercachelookups,
|
c.bufManBuffercachelookups,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
data[bufManBufferCacheHitRatioBase].FirstValue,
|
data[bufManBufferCacheHitRatioBase].SecondValue,
|
||||||
sqlInstance,
|
sqlInstance,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ func (c *Collector) collectDatabasesInstance(ch chan<- prometheus.Metric, sqlIns
|
|||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.databasesLogCacheLookups,
|
c.databasesLogCacheLookups,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
data[databasesLogCacheHitRatioBase].FirstValue,
|
data[databasesLogCacheHitRatioBase].SecondValue,
|
||||||
sqlInstance, dbName,
|
sqlInstance, dbName,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ func (c *Collector) collectLocksInstance(ch chan<- prometheus.Metric, sqlInstanc
|
|||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.locksCount,
|
c.locksCount,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
data[locksAverageWaitTimeMSBase].FirstValue/1000.0,
|
data[locksAverageWaitTimeMSBase].SecondValue/1000.0,
|
||||||
sqlInstance, lockResourceName,
|
sqlInstance, lockResourceName,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ func (c *Collector) Collect() (map[string]map[string]CounterValues, error) {
|
|||||||
values.FirstValue = float64((item.RawValue.FirstValue - WindowsEpoch) / counter.Frequency)
|
values.FirstValue = float64((item.RawValue.FirstValue - WindowsEpoch) / counter.Frequency)
|
||||||
case PERF_100NSEC_TIMER, PERF_PRECISION_100NS_TIMER:
|
case PERF_100NSEC_TIMER, PERF_PRECISION_100NS_TIMER:
|
||||||
values.FirstValue = float64(item.RawValue.FirstValue) * TicksToSecondScaleFactor
|
values.FirstValue = float64(item.RawValue.FirstValue) * TicksToSecondScaleFactor
|
||||||
case PERF_AVERAGE_BULK:
|
case PERF_AVERAGE_BULK, PERF_RAW_FRACTION:
|
||||||
values.FirstValue = float64(item.RawValue.FirstValue)
|
values.FirstValue = float64(item.RawValue.FirstValue)
|
||||||
values.SecondValue = float64(item.RawValue.SecondValue)
|
values.SecondValue = float64(item.RawValue.SecondValue)
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user