Skip to content

Graphs with multiple data sources can no longer display percenticles #4263

@KrisShannon

Description

@KrisShannon

Describe the bug

The fix for #3340 (621091f) added an early return when encountering a NaN data source.

This has stopped percentiles working on graphs with multiple data sources.

To Reproduce

Steps to reproduce the behavior:

  1. Create two data sources, one with data and the other with NaN's
  2. Create a graph using aggregate_current percentiles (e.g.|95:bits:0:aggregate_current:2|) across the two data sources.
  3. View the graph
  4. Percentiles are shown as 0

Expected behavior

Percentile calculation should ignore the NaN data source(s) and be based on any remaining sources with data.

Additional context

I've locally removed the early return from nth_percentile_fetch_statistics and the graphs appear to be working correctly:

--- lib/graph_variables.php
+++ lib/graph_variables.php
@@ -182,8 +182,6 @@ function nth_percentile_fetch_statistics($percentile, &$local_data_ids, &$fetch_array, $cf) {
 							$asum_array[$ds_name][$timestamp]  = $data;
 						}
 					}
-				} else {
-					return false;
 				}
 			}
 		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviouroutdatedNo recent activityresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions