mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-19 19:21:41 +02:00
Reduce min Go version to 1.16 and use time.Unix in gpfsMetric
This commit is contained in:
parent
151be7cccd
commit
8bd78561d8
@ -130,14 +130,21 @@ func (m *GpfsCollector) Read(interval time.Duration, output chan lp.CCMetric) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
timestampInt, err := strconv.ParseInt(key_value["_t_"]+key_value["_tu_"], 10, 64)
|
timestampSec, err := strconv.ParseInt(key_value["_t_"], 10, 64)
|
||||||
timestamp := time.UnixMicro(timestampInt)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr,
|
fmt.Fprintf(os.Stderr,
|
||||||
"GpfsCollector.Read(): Failed to convert time stamp '%s': %s\n",
|
"GpfsCollector.Read(): Failed to convert time stamp seconds '%s': %s\n",
|
||||||
key_value["_t_"]+key_value["_tu_"], err.Error())
|
key_value["_t_"], err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
timestampNano, err := strconv.ParseInt(key_value["_tu_"], 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr,
|
||||||
|
"GpfsCollector.Read(): Failed to convert time stamp nanoseconds '%s': %s\n",
|
||||||
|
key_value["_tu_"], err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
timestamp := time.Unix(timestampSec, timestampNano)
|
||||||
|
|
||||||
// bytes read
|
// bytes read
|
||||||
bytesRead, err := strconv.ParseInt(key_value["_br_"], 10, 64)
|
bytesRead, err := strconv.ParseInt(key_value["_br_"], 10, 64)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user