Skip to content

Commit 4d053b9

Browse files
AIX: Remove redundant disk blocks metric, fix times
Signed-off-by: Johannes Ziemke <github@5pi.de>
1 parent 0e88176 commit 4d053b9

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

‎collector/diskstats_aix.go

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ type diskstatsCollector struct {
3333
bsize typedDesc
3434
qdepth typedDesc
3535

36-
rblks typedDesc
37-
wblks typedDesc
38-
3936
rserv typedDesc
4037
wserv typedDesc
4138

@@ -84,22 +81,6 @@ func NewDiskstatsCollector(logger *slog.Logger) (Collector, error) {
8481
),
8582
prometheus.GaugeValue,
8683
},
87-
rblks: typedDesc{
88-
prometheus.NewDesc(
89-
prometheus.BuildFQName(namespace, diskSubsystem, "read_blocks_total"),
90-
"The total number of read blocks.",
91-
diskLabelNames, nil,
92-
),
93-
prometheus.CounterValue,
94-
},
95-
wblks: typedDesc{
96-
prometheus.NewDesc(
97-
prometheus.BuildFQName(namespace, diskSubsystem, "written_blocks_total"),
98-
"The total number of written blocks.",
99-
diskLabelNames, nil,
100-
),
101-
prometheus.CounterValue,
102-
},
10384
rserv: typedDesc{
10485
prometheus.NewDesc(
10586
prometheus.BuildFQName(namespace, diskSubsystem, "read_time_seconds_total"),
@@ -151,14 +132,12 @@ func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error {
151132
}
152133
ch <- c.rbytes.mustNewConstMetric(float64(stat.Rblks*512), stat.Name)
153134
ch <- c.wbytes.mustNewConstMetric(float64(stat.Wblks*512), stat.Name)
154-
ch <- c.time.mustNewConstMetric(float64(stat.Time)/c.tickPerSecond, stat.Name)
135+
ch <- c.time.mustNewConstMetric(float64(stat.Time)/float64(c.tickPerSecond), stat.Name)
155136

156137
ch <- c.bsize.mustNewConstMetric(float64(stat.BSize), stat.Name)
157138
ch <- c.qdepth.mustNewConstMetric(float64(stat.QDepth), stat.Name)
158-
ch <- c.rblks.mustNewConstMetric(float64(stat.Rblks), stat.Name)
159-
ch <- c.wblks.mustNewConstMetric(float64(stat.Wblks), stat.Name)
160-
ch <- c.rserv.mustNewConstMetric(float64(stat.Rserv)/c.tickPerSecond, stat.Name)
161-
ch <- c.wserv.mustNewConstMetric(float64(stat.Wserv)/c.tickPerSecond, stat.Name)
139+
ch <- c.rserv.mustNewConstMetric(float64(stat.Rserv)/1e9, stat.Name)
140+
ch <- c.wserv.mustNewConstMetric(float64(stat.Wserv)/1e9, stat.Name)
162141
ch <- c.xfers.mustNewConstMetric(float64(stat.Xfers), stat.Name)
163142
ch <- c.xrate.mustNewConstMetric(float64(stat.XRate), stat.Name)
164143
}

0 commit comments

Comments
 (0)