@@ -52,34 +52,29 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
52
52
metrics : exportedMetrics {
53
53
{
54
54
desc : prometheus .NewDesc (
55
- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds " ),
55
+ prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "seconds_total " ),
56
56
"beat.cpu.time" ,
57
57
nil , prometheus.Labels {"mode" : "system" },
58
58
),
59
- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .System .Time .MS },
59
+ eval : func (stats * Stats ) float64 {
60
+ return (time .Duration (stats .Beat .CPU .System .Time .MS ) * time .Millisecond ).Seconds ()
61
+ },
60
62
valType : prometheus .CounterValue ,
61
63
},
62
64
{
63
65
desc : prometheus .NewDesc (
64
- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds " ),
66
+ prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "seconds_total " ),
65
67
"beat.cpu.time" ,
66
68
nil , prometheus.Labels {"mode" : "user" },
67
69
),
68
- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .User .Time .MS },
69
- valType : prometheus .CounterValue ,
70
- },
71
- {
72
- desc : prometheus .NewDesc (
73
- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds" ),
74
- "beat.cpu.time" ,
75
- nil , prometheus.Labels {"mode" : "total" },
76
- ),
77
- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .Total .Time .MS },
70
+ eval : func (stats * Stats ) float64 {
71
+ return (time .Duration (stats .Beat .CPU .User .Time .MS ) * time .Millisecond ).Seconds ()
72
+ },
78
73
valType : prometheus .CounterValue ,
79
74
},
80
75
{
81
76
desc : prometheus .NewDesc (
82
- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks " ),
77
+ prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks_total " ),
83
78
"beat.cpu.ticks" ,
84
79
nil , prometheus.Labels {"mode" : "system" },
85
80
),
@@ -88,7 +83,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
88
83
},
89
84
{
90
85
desc : prometheus .NewDesc (
91
- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks " ),
86
+ prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks_total " ),
92
87
"beat.cpu.ticks" ,
93
88
nil , prometheus.Labels {"mode" : "user" },
94
89
),
@@ -97,16 +92,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
97
92
},
98
93
{
99
94
desc : prometheus .NewDesc (
100
- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks" ),
101
- "beat.cpu.ticks" ,
102
- nil , prometheus.Labels {"mode" : "total" },
103
- ),
104
- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .Total .Ticks },
105
- valType : prometheus .CounterValue ,
106
- },
107
- {
108
- desc : prometheus .NewDesc (
109
- prometheus .BuildFQName (beatInfo .Beat , "uptime" , "seconds" ),
95
+ prometheus .BuildFQName (beatInfo .Beat , "uptime" , "seconds_total" ),
110
96
"beat.info.uptime.ms" ,
111
97
nil , nil ,
112
98
),
@@ -117,7 +103,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
117
103
},
118
104
{
119
105
desc : prometheus .NewDesc (
120
- prometheus .BuildFQName (beatInfo .Beat , "memstats" , "gc_next " ),
106
+ prometheus .BuildFQName (beatInfo .Beat , "memstats" , "gc_next_total " ),
121
107
"beat.memstats.gc_next" ,
122
108
nil , nil ,
123
109
),
@@ -139,7 +125,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
139
125
},
140
126
{
141
127
desc : prometheus .NewDesc (
142
- prometheus .BuildFQName (beatInfo .Beat , "memstats" , "memory_total " ),
128
+ prometheus .BuildFQName (beatInfo .Beat , "memstats" , "memory " ),
143
129
"beat.memstats.memory_total" ,
144
130
nil , nil ,
145
131
),
0 commit comments