Merge "Change cpu load averages to be normalized by core count"
This commit is contained in:
commit
84880ba0ee
@ -342,9 +342,9 @@ This section documents the system metrics that are sent by the Agent.
|
||||
### Load
|
||||
| Metric Name | Dimensions | Semantics |
|
||||
| ----------- | ---------- | --------- |
|
||||
| load.avg_1_min | | The average system load over a 1 minute period
|
||||
| load.avg_5_min | | The average system load over a 5 minute period
|
||||
| load.avg_15_min | | The average system load over a 15 minute period
|
||||
| load.avg_1_min | | The normalized (by number of logical cores) average system load over a 1 minute period
|
||||
| load.avg_5_min | | The normalized (by number of logical cores) average system load over a 5 minute period
|
||||
| load.avg_15_min | | The normalized (by number of logical cores) average system load over a 15 minute period
|
||||
|
||||
### Memory
|
||||
| Metric Name | Dimensions | Semantics |
|
||||
|
@ -50,14 +50,21 @@ class Load(checks.AgentCheck):
|
||||
|
||||
dimensions = self._set_dimensions(None)
|
||||
|
||||
#
|
||||
# Normalize the load averages by number of cores
|
||||
# so the metric is useful for alarming across
|
||||
# hosts with varying core numbers
|
||||
#
|
||||
num_cores = psutil.cpu_count(logical=True)
|
||||
|
||||
self.gauge('load.avg_1_min',
|
||||
float(load[0]),
|
||||
round((float(load[0]) / num_cores), 3),
|
||||
dimensions=dimensions)
|
||||
self.gauge('load.avg_5_min',
|
||||
float(load[1]),
|
||||
round((float(load[1]) / num_cores), 3),
|
||||
dimensions=dimensions)
|
||||
self.gauge('load.avg_15_min',
|
||||
float(load[2]),
|
||||
round((float(load[2]) / num_cores), 3),
|
||||
dimensions=dimensions)
|
||||
|
||||
log.debug('Collected 3 load metrics')
|
||||
log.debug("Collected 3 load metrics (normalized by {} cores)".format(num_cores))
|
||||
|
Loading…
Reference in New Issue
Block a user