mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
Previously, if `cpu.max` file has only `max` resource defined without `period`, it was parsed incorrectly and silently drop error. While this syntax is valid and actually used by some container runtimes. If period is not defined, default value for it 100_000 must be used. This commit fixes parsing function by using default value for period. In addition, it adds zero value check, which fixes possible panic if period has 0 value. Related issue: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/8808