Added specs for the additional color support

This commit is contained in:
Jose Ivan Vargas 2017-09-05 15:28:38 -05:00
parent 45900c3030
commit 75b8f64ac3
4 changed files with 22 additions and 7 deletions

View file

@ -131,3 +131,20 @@
- query_range: 'sum(rate(container_cpu_usage_seconds_total{container_name!="POD",%{environment_filter}}[2m])) / count(container_cpu_usage_seconds_total{container_name!="POD",%{environment_filter}}) * 100'
label: Average
unit: "%"
- title: "CPU usage by CPU"
required_metrics:
- container_cpu_usage_seconds_total
weight: 1
queries:
- query_range: 'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) by (cpu) * 100'
unit: Average (%)
label: cpu
series:
- value: cpu00
color: red
- value: cpu01
color: blue
- value: cpu02
color: purple
- value: cpu03
color: orange

View file

@ -28,7 +28,7 @@ const defaultValuesComponent = {
currentDataIndex: 0,
};
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0].result,
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0],
defaultValuesComponent.graphWidth, defaultValuesComponent.graphHeight,
defaultValuesComponent.graphHeightOffset);
@ -38,7 +38,7 @@ function getTextFromNode(component, selector) {
return component.$el.querySelector(selector).firstChild.nodeValue.trim();
}
describe('GraphLegend', () => {
fdescribe('GraphLegend', () => {
describe('Computed props', () => {
it('textTransform', () => {
const component = createComponent(defaultValuesComponent);
@ -93,9 +93,7 @@ describe('GraphLegend', () => {
const component = createComponent(defaultValuesComponent);
const titles = component.$el.querySelectorAll('.legend-metric-title');
expect(getTextFromNode(component, '.legend-metric-title').indexOf(component.legendTitle)).not.toEqual(-1);
expect(titles[0].textContent.indexOf('Title')).not.toEqual(-1);
expect(titles[1].textContent.indexOf('Series')).not.toEqual(-1);
expect(titles[1].textContent.indexOf('series')).not.toEqual(-1);
expect(getTextFromNode(component, '.y-label-text')).toEqual(component.yAxisLabel);
});

View file

@ -13,7 +13,7 @@ const createComponent = (propsData) => {
const convertedMetrics = convertDatesMultipleSeries(singleRowMetricsMultipleSeries);
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0].result, 428, 272, 120);
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0], 428, 272, 120);
const firstTimeSeries = timeSeries[0];
describe('Monitoring Paths', () => {

View file

@ -2,7 +2,7 @@ import createTimeSeries from '~/monitoring/utils/multiple_time_series';
import { convertDatesMultipleSeries, singleRowMetricsMultipleSeries } from '../mock_data';
const convertedMetrics = convertDatesMultipleSeries(singleRowMetricsMultipleSeries);
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0].result, 428, 272, 120);
const timeSeries = createTimeSeries(convertedMetrics[0].queries[0], 428, 272, 120);
const firstTimeSeries = timeSeries[0];
describe('Multiple time series', () => {