absl::StatusOr<double> parseEffectiveCores(absl::string_view cpu_max_contents, int cpu_count) {
const int64_t total_over_period = current_cpu_times.total_time - previous_cpu_times_.total_time;
CgroupV1CpuStatsReader::CgroupV1CpuStatsReader(Filesystem::Instance& fs, TimeSource& time_source)
CgroupV1CpuStatsReader::CgroupV1CpuStatsReader(Filesystem::Instance& fs, TimeSource& time_source,
const double work_time = (cpu_times_value * CONTAINER_MILLICORES_PER_CORE) / cpu_allocated_value;
const int64_t total_over_period = current_cpu_times.total_time - previous_cpu_times_.total_time;
CgroupV2CpuStatsReader::CgroupV2CpuStatsReader(Filesystem::Instance& fs, TimeSource& time_source)
max_path_(CpuPaths::V2::getMaxPath()), effective_path_(CpuPaths::V2::getEffectiveCpusPath()) {
CgroupV2CpuStatsReader::CgroupV2CpuStatsReader(Filesystem::Instance& fs, TimeSource& time_source,
absl::StatusOr<int> cpu_count = parseEffectiveCpus(effective_result.value(), effective_path_);
ENVOY_LOG(trace, "cgroupv2 usage_usec: {}, effective_cores: {}, current_time: {}", usage_usec,
const int64_t total_over_period = current_cpu_times.total_time - previous_cpu_times_.total_time;