File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package stdout
17
17
import (
18
18
"bytes"
19
19
"fmt"
20
+ "time"
20
21
21
22
info "github.com/google/cadvisor/info/v1"
22
23
"github.com/google/cadvisor/storage"
@@ -31,6 +32,8 @@ type stdoutStorage struct {
31
32
}
32
33
33
34
const (
35
+ colTimestamp = "timestamp"
36
+ // CPU Uasge
34
37
colCpuCumulativeUsage = "cpu_cumulative_usage"
35
38
// Memory Usage
36
39
colMemoryUsage = "memory_usage"
@@ -59,6 +62,9 @@ func new() (storage.StorageDriver, error) {
59
62
func (driver * stdoutStorage ) containerStatsToValues (stats * info.ContainerStats ) (series map [string ]uint64 ) {
60
63
series = make (map [string ]uint64 )
61
64
65
+ // Unix Timestamp
66
+ series [colTimestamp ] = uint64 (time .Now ().UnixNano ())
67
+
62
68
// Cumulative Cpu Usage
63
69
series [colCpuCumulativeUsage ] = stats .Cpu .Usage .Total
64
70
You can’t perform that action at this time.
0 commit comments