Commit f4b8ec7e authored by Tristan Read's avatar Tristan Read Committed by Phil Hughes

Add requested resources to cluster health - ce port

parent 3a477fec
...@@ -69,17 +69,17 @@ export default { ...@@ -69,17 +69,17 @@ export default {
appearance && appearance.line && appearance.line.type appearance && appearance.line && appearance.line.type
? appearance.line.type ? appearance.line.type
: lineTypes.default; : lineTypes.default;
const lineColor = lineType === lineTypes.threshold ? this.primaryColor : undefined; const lineWidth =
appearance && appearance.line && appearance.line.width
? appearance.line.width
: undefined;
return { return {
name: this.formatLegendLabel(query), name: this.formatLegendLabel(query),
data: this.concatenateResults(query.result), data: this.concatenateResults(query.result),
lineStyle: { lineStyle: {
type: lineType, type: lineType,
color: lineColor, width: lineWidth,
},
itemStyle: {
color: lineColor,
}, },
areaStyle: { areaStyle: {
opacity: opacity:
......
...@@ -6,5 +6,4 @@ export const graphTypes = { ...@@ -6,5 +6,4 @@ export const graphTypes = {
export const lineTypes = { export const lineTypes = {
default: 'solid', default: 'solid',
threshold: 'dashed',
}; };
...@@ -203,6 +203,10 @@ describe('Area component', () => { ...@@ -203,6 +203,10 @@ describe('Area component', () => {
.length, .length,
).toBe(data.length); ).toBe(data.length);
}); });
it('formats line width correctly', () => {
expect(chartData[0].lineStyle.width).toBe(2);
});
}); });
describe('scatterSeries', () => { describe('scatterSeries', () => {
......
...@@ -330,6 +330,11 @@ export const metricsGroupsAPIResponse = { ...@@ -330,6 +330,11 @@ export const metricsGroupsAPIResponse = {
weight: 1, weight: 1,
queries: [ queries: [
{ {
appearance: {
line: {
width: 2,
},
},
query_range: query_range:
'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100', 'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100',
label: 'Core Usage', label: 'Core Usage',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment