Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Std dev #2983

Merged
merged 8 commits into from
Feb 11, 2015
10 changes: 9 additions & 1 deletion src/kibana/components/agg_types/_agg_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ define(function (require) {
function AggType(config) {

/**
* the unique, unchanging, name that elasticsearch has assigned this aggType
* the unique, unchanging, name that we have assigned this aggType
*
* @property name
* @type {string}
*/
this.name = config.name;

/**
* the name of the elasticsearch aggregation that this aggType represents. Usually just this.name
*
* @property name
* @type {string}
*/
this.dslName = config.dslName || config.name;

/**
* the user friendly name that will be shown in the ui for this aggType
*
Expand Down
17 changes: 0 additions & 17 deletions src/kibana/components/agg_types/controls/extended_stats.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/kibana/components/agg_types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define(function (require) {
Private(require('components/agg_types/metrics/sum')),
Private(require('components/agg_types/metrics/min')),
Private(require('components/agg_types/metrics/max')),
Private(require('components/agg_types/metrics/extended_stats')),
Private(require('components/agg_types/metrics/std_deviation')),
Private(require('components/agg_types/metrics/cardinality')),
Private(require('components/agg_types/metrics/percentiles'))
],
Expand Down
84 changes: 0 additions & 84 deletions src/kibana/components/agg_types/metrics/extended_stats.js

This file was deleted.

44 changes: 44 additions & 0 deletions src/kibana/components/agg_types/metrics/std_deviation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
define(function (require) {
return function AggTypeMetricStandardDeviationProvider(Private) {
var _ = require('lodash');
var MetricAggType = Private(require('components/agg_types/metrics/_metric_agg_type'));
var getResponseAggConfig = Private(require('components/agg_types/metrics/_get_response_agg_config'));

var valueProps = {
makeLabel: function () {
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();
}
};

return new MetricAggType({
name: 'std_dev',
dslName: 'extended_stats',
title: 'Standard Deviation',
makeLabel: function (agg) {
return 'Standard Deviation of ' + agg.fieldDisplayName();
},
params: [
{
name: 'field',
filterFieldTypes: 'number'
}
],

getResponseAggs: function (agg) {
var ValueAggConfig = getResponseAggConfig(agg, valueProps);
return [
new ValueAggConfig('std_deviation_bounds.lower'),
new ValueAggConfig('avg'),
new ValueAggConfig('std_deviation_bounds.upper')
];
},

getValue: function (agg, bucket) {
return _.get(bucket[agg.parentId], agg.key);
}
});
};
});
2 changes: 1 addition & 1 deletion src/kibana/components/vis/_agg_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ define(function (require) {
var output = this.write();

var configDsl = {};
configDsl[this.type.name] = output.params;
configDsl[this.type.dslName || this.type.name] = output.params;

// if the config requires subAggs, write them to the dsl as well
if (output.subAggs) {
Expand Down
1 change: 1 addition & 0 deletions src/kibana/plugins/vis_types/vislib/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define(function (require) {
name: 'metric',
title: 'Y-Axis',
min: 1,
aggFilter: '!std_deviation',
defaults: [
{ schema: 'metric', type: 'count' }
]
Expand Down
1 change: 1 addition & 0 deletions src/kibana/plugins/vis_types/vislib/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define(function (require) {
name: 'metric',
title: 'Y-Axis',
min: 1,
aggFilter: '!std_deviation',
defaults: [
{ schema: 'metric', type: 'count' }
]
Expand Down
6 changes: 5 additions & 1 deletion tasks/config/esvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ module.exports = function (grunt) {
var join = require('path').join;
var rel = require('path').join.bind(null, grunt.config.get('root'));
var directory = join(grunt.config.get('root'), 'esvm');
var dataDir = join(directory, 'data_dir');

return {
options: {
directory: directory,
version: '1.4.2',
version: '1.4.3',
plugins: [
'elasticsearch/marvel/latest'
],
config: {
path: {
data: dataDir
},
network: {
host: '127.0.0.1'
},
Expand Down
3 changes: 1 addition & 2 deletions test/unit/specs/components/agg_types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ define(function (require) {
require('specs/components/agg_types/_agg_params'),
require('specs/components/agg_types/_bucket_count_between'),
require('specs/components/agg_types/buckets/_histogram'),
require('specs/components/agg_types/buckets/_date_histogram'),
require('specs/components/agg_types/metrics/_extended_stats')
require('specs/components/agg_types/buckets/_date_histogram')
].forEach(function (s) {
describe(s[0], s[1]);
});
Expand Down
104 changes: 0 additions & 104 deletions test/unit/specs/components/agg_types/metrics/_extended_stats.js

This file was deleted.