mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Mon Aug 26 20:34:39 CEST 2024
This commit is contained in:
@@ -249,7 +249,7 @@ func (b *readerImpl) parseNetworkInfo(metricMap map[string]*dto.MetricFamily, nm
|
||||
}
|
||||
|
||||
if b.lastMetrics != nil {
|
||||
passedTime := now.Sub(b.lastMetrics.syncTime).Seconds()
|
||||
passedTime := now.Sub(b.lastMetrics.SyncTime).Seconds()
|
||||
nm.NetworkReceiveBytesRate = (nm.NetworkReceiveBytesTotal - b.lastMetrics.NetworkReceiveBytesTotal) / passedTime
|
||||
nm.NetworkTransmitBytesRate = (nm.NetworkTransmitBytesTotal - b.lastMetrics.NetworkTransmitBytesTotal) / passedTime
|
||||
}
|
||||
@@ -272,7 +272,7 @@ func (b *readerImpl) ReadOnce(ctx context.Context) (*NodeMetrics, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nm := &NodeMetrics{syncTime: time.Now(), PingMetrics: []PingMetric{}}
|
||||
nm := &NodeMetrics{SyncTime: time.Now(), PingMetrics: []PingMetric{}}
|
||||
if err := b.parseCpuInfo(parsed, nm); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type NodeMetrics struct {
|
||||
// ping
|
||||
PingMetrics []PingMetric `json:"ping_metrics"`
|
||||
|
||||
syncTime time.Time
|
||||
SyncTime time.Time
|
||||
}
|
||||
|
||||
type PingMetric struct {
|
||||
|
||||
Reference in New Issue
Block a user