update es version and use extended_stats.std_deviation_bounds

This commit is contained in:
Spencer Alger 2015-02-10 18:18:09 -07:00
parent 876c3fd8e2
commit e37fa32847
2 changed files with 8 additions and 13 deletions

View file

@ -6,7 +6,10 @@ define(function (require) {
var valueProps = {
makeLabel: function () {
return this.key + ' of ' + this.fieldDisplayName();
var title = 'Average';
if (this.key === 'std_deviation_bounds.lower') title = 'Lower Standard Deviation';
if (this.key === 'std_deviation_bounds.upper') title = 'Upper Standard Deviation';
return title + ' of ' + this.fieldDisplayName();
}
};
@ -26,22 +29,14 @@ define(function (require) {
getResponseAggs: function (agg) {
var ValueAggConfig = getResponseAggConfig(agg, valueProps);
return [
new ValueAggConfig('upper_std_deviation'),
new ValueAggConfig('std_deviation_bounds.lower'),
new ValueAggConfig('avg'),
new ValueAggConfig('lower_std_deviation')
new ValueAggConfig('std_deviation_bounds.upper')
];
},
getValue: function (agg, bucket) {
var stats = bucket[agg.parentId];
switch (agg.key) {
case 'upper_std_deviation':
return stats.avg + stats.std_deviation;
case 'lower_std_deviation':
return stats.avg - stats.std_deviation;
case 'avg':
return stats.avg;
}
return _.get(bucket[agg.parentId], agg.key);
}
});
};

View file

@ -6,7 +6,7 @@ module.exports = function (grunt) {
return {
options: {
directory: directory,
version: '1.4.2',
branch: '1.4.3',
plugins: [
'elasticsearch/marvel/latest'
],