Skip to content

Commit

Permalink
TSVB doesn't work for percentile aggregation in Gauge, metric and Top…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Feb 22, 2019
1 parent 43caa27 commit c2f952d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ describe('percentile(resp, panel, series)', () => {
const results = percentile(resp, panel, series)(next)([]);
expect(results).to.have.length(3);

expect(results[0]).to.have.property('id', '10-90:test');
expect(results[0]).to.have.property('id', 'test:10-90');
expect(results[0]).to.have.property('color', 'rgb(255, 0, 0)');
expect(results[0]).to.have.property('fillBetween', '10-90:test:90');
expect(results[0]).to.have.property('fillBetween', 'test:10-90:90');
expect(results[0]).to.have.property('label', 'Percentile of cpu (10)');
expect(results[0]).to.have.property('legend', false);
expect(results[0]).to.have.property('lines');
Expand All @@ -109,7 +109,7 @@ describe('percentile(resp, panel, series)', () => {
[2, 1.2]
]);

expect(results[1]).to.have.property('id', '10-90:test:90');
expect(results[1]).to.have.property('id', 'test:10-90:90');
expect(results[1]).to.have.property('color', 'rgb(255, 0, 0)');
expect(results[1]).to.have.property('label', 'Percentile of cpu (10)');
expect(results[1]).to.have.property('legend', false);
Expand All @@ -126,7 +126,7 @@ describe('percentile(resp, panel, series)', () => {
[2, 5.3]
]);

expect(results[2]).to.have.property('id', '50:test');
expect(results[2]).to.have.property('id', 'test:50');
expect(results[2]).to.have.property('color', 'rgb(255, 0, 0)');
expect(results[2]).to.have.property('label', 'Percentile of cpu (50)');
expect(results[2]).to.have.property('stack', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ export default function percentile(resp, panel, series) {
return [bucket.key, getAggValue(bucket, m)];
});
results.push({
id: `${percentile.id}:${split.id}`,
id: `${split.id}:${percentile.id}`,
color: split.color,
label,
data,
lines: { show: true, fill: percentile.shade, lineWidth: 0 },
points: { show: false },
legend: false,
fillBetween: `${percentile.id}:${split.id}:${percentile.percentile}`
fillBetween: `${split.id}:${percentile.id}:${percentile.percentile}`
});
results.push({
id: `${percentile.id}:${split.id}:${percentile.percentile}`,
id: `${split.id}:${percentile.id}:${percentile.percentile}`,
color: split.color,
label,
data: fillData,
Expand All @@ -61,7 +61,7 @@ export default function percentile(resp, panel, series) {
} else {
const decoration = getDefaultDecoration(series);
results.push({
id: `${percentile.id}:${split.id}`,
id: `${split.id}:${percentile.id}`,
color: split.color,
label,
data,
Expand Down

0 comments on commit c2f952d

Please sign in to comment.