vrk-kpa / xroad-joint-development

Unmaintained repository. Development moved to: https://github.com/nordic-institute/X-Road-development
19 stars 8 forks source link

BUG: As a Security Server Admin I want that the calculation of SystemCpuLoad metric value is fixed so that the correct cpuload value is returned #194

Closed hanhaka closed 6 years ago

hanhaka commented 6 years ago

Affected components: ENV Monitoring Affected documentation: ARC-ENVMON Estimated delivery: Q1 / 2018 External reference: https://jira.csc.fi/browse/PVAYLADEV-1042

Problem SystemMetricsSensor, that is calculating and returning value of SystemCpuLoad metric, is not returning the correct value. ENV Monitoring component is using this metric value as a part of environmental monitoring data-set.

Value should be calculated as follows: .update(stats.getSystemCpuLoad() * SYSTEM_CPU_LOAD_MULTIPLIER);

Currently it is not calculated as stated above, implementation must be changed to obtain correct cpuload value. Note that getSystemCpuLoad returns values from 0.0 to 1.0. Multiplication with 100 makes this number a percent. It must be take notice that this value is not classical load average (from uptime) and to clarify this, it needs to be documented to avoid confusion. For example “this value returns CPU load percentage of the system”.

Additionally getSystemCpuLoad may return negative value when system recent cpu usage is not available. The new implementation must handle this situation and if negative value is detected, returned value has to set to 0.

Acceptance criteria

hanhaka commented 6 years ago

Fixed in 6.17.0, see: https://github.com/ria-ee/X-Road/pull/73