Add cgroup memory usage/limit to OS stats on Linux (elastic/x-pack-elasticsearch#2614)

This change adapts the monitoring tests to account for an addition to
the OS stats made in elastic/elasticsearch#26166.

Original commit: elastic/x-pack-elasticsearch@9e36764857
This commit is contained in:
David Roberts 2017-10-03 12:09:59 +01:00 committed by GitHub
parent 3e0644b891
commit c7b4ef9a89
5 changed files with 26 additions and 4 deletions

View File

@ -119,6 +119,9 @@ public class NodeStatsMonitoringDoc extends FilteredMonitoringDoc {
"node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods",
"node_stats.os.cgroup.cpu.stat.number_of_times_throttled",
"node_stats.os.cgroup.cpu.stat.time_throttled_nanos",
"node_stats.os.cgroup.memory.control_group",
"node_stats.os.cgroup.memory.limit_in_bytes",
"node_stats.os.cgroup.memory.usage_in_bytes",
"node_stats.os.cpu.load_average.1m",
"node_stats.os.cpu.load_average.5m",
"node_stats.os.cpu.load_average.15m",
@ -155,4 +158,4 @@ public class NodeStatsMonitoringDoc extends FilteredMonitoringDoc {
"node_stats.thread_pool.watcher.threads",
"node_stats.thread_pool.watcher.queue",
"node_stats.thread_pool.watcher.rejected");
}
}

View File

@ -26,7 +26,7 @@ public final class MonitoringTemplateUtils {
* <p>
* It may be possible for this to diverge between templates and pipelines, but for now they're the same.
*/
public static final int LAST_UPDATED_VERSION = Version.V_6_0_0_beta1.id;
public static final int LAST_UPDATED_VERSION = Version.V_7_0_0_alpha1.id;
/**
* Current version of templates used in their name to differentiate from breaking changes (separate from product version).

View File

@ -1,6 +1,6 @@
{
"index_patterns": ".monitoring-alerts-${monitoring.template.version}",
"version": 6000026,
"version": 7000001,
"settings": {
"index": {
"number_of_shards": 1,

View File

@ -639,6 +639,19 @@
}
}
}
},
"memory": {
"properties": {
"control_group": {
"type": "keyword"
},
"limit_in_bytes": {
"type": "keyword"
},
"usage_in_bytes": {
"type": "keyword"
}
}
}
}
},

View File

@ -188,6 +188,11 @@ public class NodeStatsMonitoringDocTests extends BaseFilteredMonitoringDocTestCa
+ "\"number_of_times_throttled\":45,"
+ "\"time_throttled_nanos\":46"
+ "}"
+ "},"
+ "\"memory\":{"
+ "\"control_group\":\"_memory_ctrl_group\","
+ "\"limit_in_bytes\":\"2000000000\","
+ "\"usage_in_bytes\":\"1000000000\""
+ "}"
+ "}"
+ "},"
@ -327,7 +332,8 @@ public class NodeStatsMonitoringDocTests extends BaseFilteredMonitoringDocTestCa
// Os
final OsStats.Cpu osCpu = new OsStats.Cpu((short) no, new double[]{++iota, ++iota, ++iota});
final OsStats.Cgroup.CpuStat osCpuStat = new OsStats.Cgroup.CpuStat(++iota, ++iota, ++iota);
final OsStats.Cgroup osCgroup = new OsStats.Cgroup("_cpu_acct_ctrl_group", ++iota, "_cpu_ctrl_group", ++iota, ++iota, osCpuStat);
final OsStats.Cgroup osCgroup = new OsStats.Cgroup("_cpu_acct_ctrl_group", ++iota, "_cpu_ctrl_group", ++iota, ++iota, osCpuStat,
"_memory_ctrl_group", "2000000000", "1000000000");
final OsStats.Mem osMem = new OsStats.Mem(no, no);
final OsStats.Swap osSwap = new OsStats.Swap(no, no);