File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
qa/docker/shared_examples Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 8787 expect ( java_process ( @container ) [ "args" ] ) . to match /-Dls.cgroup.cpuacct.path.override=/
8888 end
8989
90+ it 'should report cgroup cpu and cpuacct stats via the monitoring API' do
91+ node_stats = get_node_stats ( @container )
92+ cgroup = node_stats . dig ( 'os' , 'cgroup' )
93+ expect ( cgroup ) . not_to be_nil , "Expected cgroup stats in /_node/stats response"
94+
95+ expect ( cgroup . dig ( 'cpuacct' , 'control_group' ) ) . to be_a ( String )
96+ expect ( cgroup . dig ( 'cpuacct' , 'usage_nanos' ) ) . to be >= 0
97+
98+ expect ( cgroup . dig ( 'cpu' , 'control_group' ) ) . to be_a ( String )
99+ expect ( cgroup . dig ( 'cpu' , 'cfs_period_micros' ) ) . to be > 0
100+ expect ( cgroup . dig ( 'cpu' , 'stat' , 'number_of_elapsed_periods' ) ) . to be >= -1
101+ expect ( cgroup . dig ( 'cpu' , 'stat' , 'number_of_times_throttled' ) ) . to be >= -1
102+ expect ( cgroup . dig ( 'cpu' , 'stat' , 'time_throttled_nanos' ) ) . to be >= -1
103+ end
104+
90105 it 'should have a pid of 1' do
91106 expect ( java_process ( @container ) [ "pid" ] ) . to eql '1'
92107 end
You can’t perform that action at this time.
0 commit comments