mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-16 01:33:07 +01:00
Calculate bytes read/written
This commit is contained in:
parent
1b15cbbec2
commit
315d1538aa
2 changed files with 12 additions and 12 deletions
|
@ -206,8 +206,8 @@ var (
|
|||
},
|
||||
nil,
|
||||
)
|
||||
metricDeviceDataUnitsRead = prometheus.NewDesc(
|
||||
"smartctl_device_data_units_read",
|
||||
metricDeviceBytesRead = prometheus.NewDesc(
|
||||
"smartctl_device_bytes_read",
|
||||
"",
|
||||
[]string{
|
||||
"device",
|
||||
|
@ -217,8 +217,8 @@ var (
|
|||
},
|
||||
nil,
|
||||
)
|
||||
metricDeviceDataUnitsWritten = prometheus.NewDesc(
|
||||
"smartctl_device_data_units_written",
|
||||
metricDeviceBytesWritten = prometheus.NewDesc(
|
||||
"smartctl_device_bytes_written",
|
||||
"",
|
||||
[]string{
|
||||
"device",
|
||||
|
|
16
smartctl.go
16
smartctl.go
|
@ -56,8 +56,8 @@ func (smart *SMARTctl) Collect() {
|
|||
smart.mineCriticalWarning()
|
||||
smart.mineMediaErrors()
|
||||
smart.mineNumErrLogEntries()
|
||||
smart.mineDataUnitsRead()
|
||||
smart.mineDataUnitsWritten()
|
||||
smart.mineBytesRead()
|
||||
smart.mineBytesWritten()
|
||||
smart.mineSmartStatus()
|
||||
|
||||
}
|
||||
|
@ -312,10 +312,10 @@ func (smart *SMARTctl) mineNumErrLogEntries() {
|
|||
)
|
||||
}
|
||||
|
||||
func (smart *SMARTctl) mineDataUnitsRead() {
|
||||
blockSize := smart.json.Get("logical_block_size").Float()
|
||||
func (smart *SMARTctl) mineBytesRead() {
|
||||
blockSize := smart.json.Get("logical_block_size").Float() * 1024
|
||||
smart.ch <- prometheus.MustNewConstMetric(
|
||||
metricDeviceDataUnitsRead,
|
||||
metricDeviceBytesRead,
|
||||
prometheus.CounterValue,
|
||||
smart.json.Get("nvme_smart_health_information_log.data_units_read").Float() * blockSize,
|
||||
smart.device.device,
|
||||
|
@ -325,10 +325,10 @@ func (smart *SMARTctl) mineDataUnitsRead() {
|
|||
)
|
||||
}
|
||||
|
||||
func (smart *SMARTctl) mineDataUnitsWritten() {
|
||||
blockSize := smart.json.Get("logical_block_size").Float()
|
||||
func (smart *SMARTctl) mineBytesWritten() {
|
||||
blockSize := smart.json.Get("logical_block_size").Float() * 1024
|
||||
smart.ch <- prometheus.MustNewConstMetric(
|
||||
metricDeviceDataUnitsWritten,
|
||||
metricDeviceBytesWritten,
|
||||
prometheus.CounterValue,
|
||||
smart.json.Get("nvme_smart_health_information_log.data_units_written").Float() * blockSize,
|
||||
smart.device.device,
|
||||
|
|
Loading…
Reference in a new issue