TSVB doesn't work for percentile aggregation in Gauge, metric and Top N (#31680) (#31795)

This commit is contained in:
Alexey Antonov 2019-02-22 15:58:55 +03:00 committed by GitHub
parent bb06b0a0c9
commit 6c4f23c8c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -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');
@ -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);
@ -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);

View file

@ -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,
@ -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,