Activity log for bug #1488696

Date Who What changed Old value New value Message
2015-08-25 23:58:20 Joe Cropper bug added bug
2015-08-26 00:05:14 Joe Cropper description It seems that with the recent update to the Nova virt metrics framework, the 'percent' related metrics always 0 now in the database. After tracing through the code, I determined tha the virt_driver and resource tracker will still behaving properly and the compute_driver::get_host_cpu_stats work as expected. It seems that the root cause is: https://github.com/openstack/nova/blob/master/nova/objects/monitor_metric.py#L29 This shows that the metric value is expected to be an integer in nova object, but the percentage metrics are all floating points and range in value from [0, 1] -- e.g., so 17.5% has been historically represented as 0.175 using the monitor framework. This causes the percentage values to assume the value 0, as shown below in the snippet from `select metrics from compute_nodes`: "cpu.user.percent", "value": 0, "cpu.percent", "value": 0, ...so on and so forth. I'm not sure if the intended behavior here was to only support integer-style values. If so, we probably need to do some "multiply by 100" logic when putting them into the MonitorMetric object and then divide by 100 (we'll lose precision, though) when we convert back to the values stored in the compute_nodes.metrics column, otherwise we will break backwards compatibility in terms of what folks were expecting to find in the DB. It seems that with the recent update to the Nova virt metrics framework, the 'percent' related metrics always 0 now in the database. After tracing through the code, I determined tha the virt_driver and resource tracker will still behaving properly and the compute_driver::get_host_cpu_stats work as expected. It seems that the root cause is: https://github.com/openstack/nova/blob/master/nova/objects/monitor_metric.py#L29 This shows that the metric value is expected to be an integer in nova object, but the percentage metrics are all floating points and range in value from [0, 1] -- e.g., so 17.5% has been historically represented as 0.175 using the monitor framework. This causes the percentage values to assume the value 0, as shown below in the snippet from `select metrics from compute_nodes`: "cpu.user.percent", "value": 0, "cpu.percent", "value": 0, ...so on and so forth. By the time the metrics get to this spot in the resource tracker: https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L366 ...the '*.percent' values are all 0. I'm not sure if the intended behavior here was to only support integer-style values. If so, we probably need to do some "multiply by 100" logic when putting them into the MonitorMetric object and then divide by 100 (we'll lose precision, though) when we convert back to the values stored in the compute_nodes.metrics column, otherwise we will break backwards compatibility in terms of what folks were expecting to find in the DB.
2015-08-26 00:06:01 Joe Cropper description It seems that with the recent update to the Nova virt metrics framework, the 'percent' related metrics always 0 now in the database. After tracing through the code, I determined tha the virt_driver and resource tracker will still behaving properly and the compute_driver::get_host_cpu_stats work as expected. It seems that the root cause is: https://github.com/openstack/nova/blob/master/nova/objects/monitor_metric.py#L29 This shows that the metric value is expected to be an integer in nova object, but the percentage metrics are all floating points and range in value from [0, 1] -- e.g., so 17.5% has been historically represented as 0.175 using the monitor framework. This causes the percentage values to assume the value 0, as shown below in the snippet from `select metrics from compute_nodes`: "cpu.user.percent", "value": 0, "cpu.percent", "value": 0, ...so on and so forth. By the time the metrics get to this spot in the resource tracker: https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L366 ...the '*.percent' values are all 0. I'm not sure if the intended behavior here was to only support integer-style values. If so, we probably need to do some "multiply by 100" logic when putting them into the MonitorMetric object and then divide by 100 (we'll lose precision, though) when we convert back to the values stored in the compute_nodes.metrics column, otherwise we will break backwards compatibility in terms of what folks were expecting to find in the DB. It seems that with the recent update to the Nova virt metrics framework in Liberty, the 'percent' related metrics always 0 now in the database. After tracing through the code, I determined tha the virt_driver and resource tracker will still behaving properly and the compute_driver::get_host_cpu_stats work as expected. It seems that the root cause is: https://github.com/openstack/nova/blob/master/nova/objects/monitor_metric.py#L29 This shows that the metric value is expected to be an integer in nova object, but the percentage metrics are all floating points and range in value from [0, 1] -- e.g., so 17.5% has been historically represented as 0.175 using the monitor framework. This causes the percentage values to assume the value 0, as shown below in the snippet from `select metrics from compute_nodes`: "cpu.user.percent", "value": 0, "cpu.percent", "value": 0, ...so on and so forth. By the time the metrics get to this spot in the resource tracker: https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L366 ...the '*.percent' values are all 0. I'm not sure if the intended behavior here was to only support integer-style values. If so, we probably need to do some "multiply by 100" logic when putting them into the MonitorMetric object and then divide by 100 (we'll lose precision, though) when we convert back to the values stored in the compute_nodes.metrics column, otherwise we will break backwards compatibility in terms of what folks were expecting to find in the DB.
2015-08-26 00:12:23 Joe Cropper summary Compute *.percent metrics are always 0 Compute *.percent Nova metrics are always 0
2015-08-26 00:12:55 Joe Cropper summary Compute *.percent Nova metrics are always 0 Nova compute *.percent metrics are always 0
2015-08-26 00:15:28 Joe Cropper bug added subscriber Jay Pipes
2015-08-26 01:58:40 Zhihai Song bug added subscriber Zhihai Song
2015-08-26 02:01:39 OpenStack Infra nova: status New In Progress
2015-08-26 02:01:39 OpenStack Infra nova: assignee Joe Cropper (jwcroppe)
2015-08-26 14:27:30 Sylvain Bauza nova: importance Undecided Medium
2015-08-28 09:03:12 OpenStack Infra nova: status In Progress Fix Committed
2015-09-03 11:46:02 Thierry Carrez nova: status Fix Committed Fix Released
2015-09-03 11:46:02 Thierry Carrez nova: milestone liberty-3
2015-10-15 08:58:50 Thierry Carrez nova: milestone liberty-3 12.0.0