Skip to content

Commit

Permalink
fix: rename bucket_sizes to buckets_sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
NivLipetz committed Dec 8, 2020
1 parent 0876d2b commit e16a596
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/adapters/prometheusAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ module.exports.buildMetricsPlugin = (metricsConfig, jobConfig) => {
}
};

if (metricsConfig.bucket_sizes) {
prometheusPlugin.prometheus.bucketSizes = metricsConfig.bucket_sizes;
if (metricsConfig.buckets_sizes) {
prometheusPlugin.prometheus.bucketSizes = metricsConfig.buckets_sizes;
}

return prometheusPlugin;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit-tests/adapters/prometheusAdapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const expectedPluginConfiguartion = {
};

describe('Prometheus adapter test', () => {
it('Should retrieve prometheus plugin configuration without bucket_sizes or labels', () => {
it('Should retrieve prometheus plugin configuration without buckets_sizes or labels', () => {
const pluginConfiguration = prometheusAdapter.buildMetricsPlugin(metricsConfig, jobConfig);
should(pluginConfiguration).eql(expectedPluginConfiguartion);
});

it('Should retrieve prometheus plugin configuration with bucket_sizes and labels', () => {
metricsConfig.bucket_sizes = [0.5, 1, 5, 10, 100];
it('Should retrieve prometheus plugin configuration with buckets_sizes and labels', () => {
metricsConfig.buckets_sizes = [0.5, 1, 5, 10, 100];
metricsConfig.labels = { key1: 'value2', key2: 'value2' };
const pluginConfiguration = prometheusAdapter.buildMetricsPlugin(metricsConfig, jobConfig);
expectedPluginConfiguartion.prometheus.bucketSizes = [0.5, 1, 5, 10, 100];
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports.EXPECTED_ARTILLERY_CUSTOM_TEST = {

module.exports.PROMETHEUS_CONFIGURATION = {
push_gateway_url: 'http://pushgateway.com',
bucket_sizes: [0.5, 1, 2, 5, 10]
buckets_sizes: [0.5, 1, 2, 5, 10]
};

module.exports.INFLUX_CONFIGURATION = {
Expand Down

0 comments on commit e16a596

Please sign in to comment.