Add requested resources to cluster health - ce port

This commit is contained in:
Tristan Read 2019-03-29 08:33:10 +00:00 committed by Phil Hughes
parent 3a477fec8f
commit f4b8ec7ea1
4 changed files with 14 additions and 6 deletions

View file

@ -69,17 +69,17 @@ export default {
appearance && appearance.line && appearance.line.type
? appearance.line.type
: lineTypes.default;
const lineColor = lineType === lineTypes.threshold ? this.primaryColor : undefined;
const lineWidth =
appearance && appearance.line && appearance.line.width
? appearance.line.width
: undefined;
return {
name: this.formatLegendLabel(query),
data: this.concatenateResults(query.result),
lineStyle: {
type: lineType,
color: lineColor,
},
itemStyle: {
color: lineColor,
width: lineWidth,
},
areaStyle: {
opacity:

View file

@ -6,5 +6,4 @@ export const graphTypes = {
export const lineTypes = {
default: 'solid',
threshold: 'dashed',
};

View file

@ -203,6 +203,10 @@ describe('Area component', () => {
.length,
).toBe(data.length);
});
it('formats line width correctly', () => {
expect(chartData[0].lineStyle.width).toBe(2);
});
});
describe('scatterSeries', () => {

View file

@ -330,6 +330,11 @@ export const metricsGroupsAPIResponse = {
weight: 1,
queries: [
{
appearance: {
line: {
width: 2,
},
},
query_range:
'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100',
label: 'Core Usage',