| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| { |
| include: [ "//src/sys/test_runners/inspect/default.shard.cml" ], |
| program: { |
| accessor: "ALL", |
| timeout_seconds: "60", |
| cases: [ |
| // Ensure that component manager has at least one CPU sample |
| // and that all present samples are greater than 0. |
| // Samples must contain non-zero entries for cpu_time, |
| // queue_time, and timestamp. |
| "<component_manager>:root/cpu_stats/measurements/components/<component_manager>/*/@samples/*:cpu_time WHERE [a] And(Count(a) > 0, Count(a) == Count(Filter(Fn([b], b > 0), a)))", |
| "<component_manager>:root/cpu_stats/measurements/components/<component_manager>/*/@samples/*:queue_time WHERE [a] And(Count(a) > 0, Count(a) == Count(Filter(Fn([b], b > 0), a)))", |
| "<component_manager>:root/cpu_stats/measurements/components/<component_manager>/*/@samples/*:timestamp WHERE [a] And(Count(a) > 0, Count(a) == Count(Filter(Fn([b], b > 0), a)))", |
| |
| // Ensure that appmgr has at least one CPU sample |
| // and that all present samples are greater than 0. |
| // Cpu time and queue time might be zero since appmgr's first |
| // measurement is from when it is one of the few processes |
| // running on the system. |
| "<component_manager>:root/cpu_stats/measurements/components/core\\/appmgr/*/@samples/*:cpu_time WHERE [a] Count(a) > 0", |
| "<component_manager>:root/cpu_stats/measurements/components/core\\/appmgr/*/@samples/*:queue_time WHERE [a] Count(a) > 0", |
| "<component_manager>:root/cpu_stats/measurements/components/core\\/appmgr/*/@samples/*:timestamp WHERE [a] And(Count(a) > 0, Count(a) == Count(Filter(Fn([b], b > 0), a)))", |
| |
| // Ensure that component manager has at least 2MB of space for CPU measurements and that not all of it is used. |
| // "<component_manager>:root/cpu_stats/measurements/fuchsia.inspect.Stats:current_size WHERE [a] a < 2*1024*1024", |
| // "<component_manager>:root/cpu_stats/measurements/fuchsia.inspect.Stats:maximum_size WHERE [a] a >= 2*1024*1024", |
| |
| // Component manager exposes the number of tracked tasks, and the value is not zero. |
| "<component_manager>:root/cpu_stats/measurements:task_count WHERE [a] a > 0", |
| |
| // Component manager contains recent cpu usage stats. If |
| // previous is not included, there are 3 measurements, otherwise |
| // there are 6. |
| "<component_manager>:root/cpu_stats/recent_usage:* WHERE [a] Or(Count(a) == 3, Count(a) == 6)", |
| |
| // Component manager exposes cpu stats processing times. |
| "<component_manager>:root/cpu_stats:processing_times_ns WHERE [a] UnhandledType(a)", |
| |
| // Component manager exposes cpu histograms. |
| "<component_manager>:root/cpu_stats/histograms:\\/bootstrap\\/archivist WHERE [a] UnhandledType(a)", |
| ], |
| }, |
| } |