Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[aggType/percentile] read new { key, value } response format
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 23, 2016
1 parent 4193985 commit 7682eb5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ui/public/agg_types/metrics/percentiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ export default function AggTypeMetricPercentilesProvider(Private) {
});
},
getValue: function (agg, bucket) {
// percentiles for 1, 5, and 10 will come back as 1.0, 5.0, and 10.0 so we
// parse the keys and respond with the value that matches
return _.find(bucket[agg.parentId] && bucket[agg.parentId].values, function (value, key) {
return agg.key === parseFloat(key);
});
const values = bucket[agg.parentId] && bucket[agg.parentId].values;
const percentile = _.find(values, value => agg.key === value.key);
return percentile ? percentile.value : null;
}
});
};

0 comments on commit 7682eb5

Please sign in to comment.