Skip to content

Commit

Permalink
logicaldisk: fix base counter values (#1747)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke authored Nov 19, 2024
1 parent c6ee794 commit 2335fba
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/collector/logical_disk/logical_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
ch <- prometheus.MustNewConstMetric(
c.totalSpace,
prometheus.GaugeValue,
volume[percentFreeSpace].FirstValue*1024*1024,
volume[percentFreeSpace].SecondValue*1024*1024,
name,
)

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/mssql/mssql_access_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ func (c *Collector) collectAccessMethodsInstance(ch chan<- prometheus.Metric, sq
ch <- prometheus.MustNewConstMetric(
c.accessMethodsWorktablesFromCacheLookups,
prometheus.CounterValue,
data[accessMethodsWorktablesFromCacheRatioBase].FirstValue,
data[accessMethodsWorktablesFromCacheRatioBase].SecondValue,
sqlInstance,
)

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/mssql/mssql_buffer_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (c *Collector) collectBufferManagerInstance(ch chan<- prometheus.Metric, sq
ch <- prometheus.MustNewConstMetric(
c.bufManBuffercachelookups,
prometheus.GaugeValue,
data[bufManBufferCacheHitRatioBase].FirstValue,
data[bufManBufferCacheHitRatioBase].SecondValue,
sqlInstance,
)

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/mssql/mssql_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func (c *Collector) collectDatabasesInstance(ch chan<- prometheus.Metric, sqlIns
ch <- prometheus.MustNewConstMetric(
c.databasesLogCacheLookups,
prometheus.GaugeValue,
data[databasesLogCacheHitRatioBase].FirstValue,
data[databasesLogCacheHitRatioBase].SecondValue,
sqlInstance, dbName,
)

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/mssql/mssql_locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *Collector) collectLocksInstance(ch chan<- prometheus.Metric, sqlInstanc
ch <- prometheus.MustNewConstMetric(
c.locksCount,
prometheus.GaugeValue,
data[locksAverageWaitTimeMSBase].FirstValue/1000.0,
data[locksAverageWaitTimeMSBase].SecondValue/1000.0,
sqlInstance, lockResourceName,
)

Expand Down
2 changes: 1 addition & 1 deletion internal/perfdata/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (c *Collector) Collect() (map[string]map[string]CounterValues, error) {
values.FirstValue = float64((item.RawValue.FirstValue - WindowsEpoch) / counter.Frequency)
case PERF_100NSEC_TIMER, PERF_PRECISION_100NS_TIMER:
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.SecondValue = float64(item.RawValue.SecondValue)
default:
Expand Down

0 comments on commit 2335fba

Please sign in to comment.