@@ -33,9 +33,6 @@ type diskstatsCollector struct {
33
33
bsize typedDesc
34
34
qdepth typedDesc
35
35
36
- rblks typedDesc
37
- wblks typedDesc
38
-
39
36
rserv typedDesc
40
37
wserv typedDesc
41
38
@@ -84,22 +81,6 @@ func NewDiskstatsCollector(logger *slog.Logger) (Collector, error) {
84
81
),
85
82
prometheus .GaugeValue ,
86
83
},
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
- },
103
84
rserv : typedDesc {
104
85
prometheus .NewDesc (
105
86
prometheus .BuildFQName (namespace , diskSubsystem , "read_time_seconds_total" ),
@@ -151,14 +132,12 @@ func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error {
151
132
}
152
133
ch <- c .rbytes .mustNewConstMetric (float64 (stat .Rblks * 512 ), stat .Name )
153
134
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 )
155
136
156
137
ch <- c .bsize .mustNewConstMetric (float64 (stat .BSize ), stat .Name )
157
138
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 )
162
141
ch <- c .xfers .mustNewConstMetric (float64 (stat .Xfers ), stat .Name )
163
142
ch <- c .xrate .mustNewConstMetric (float64 (stat .XRate ), stat .Name )
164
143
}
0 commit comments