Skip to content

Commit 9a7a190

Browse files
Merge pull request #503 from etmurasaki/metrics
OU-932: automation - metrics
2 parents a155db1 + 92958c5 commit 9a7a190

File tree

14 files changed

+1220
-32
lines changed

14 files changed

+1220
-32
lines changed

web/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default defineConfig({
2121
),
2222
LOGIN_USERNAME: process.env.CYPRESS_LOGIN_USERS.split(',')[0].split(':')[0],
2323
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_USERS.split(',')[0].split(':')[1],
24+
typeDelay: 200,
2425
},
2526
fixturesFolder: 'fixtures',
2627
defaultCommandTimeout: 80000, //due to performance loading issue on console

web/cypress/downloads/openshift.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

web/cypress/e2e/monitoring/regression/02.reg_metrics.cy.ts

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
export enum AlertsAlertState {
2+
FIRING = 'Firing',
3+
PENDING = 'Pending',
4+
SILENCED = 'Silenced',
5+
};
6+
7+
export enum AlertingRulesAlertState {
8+
FIRING = 'Firing',
9+
PENDING = 'Pending',
10+
SILENCED = 'Silenced',
11+
NOT_FIRING = 'Not Firing',
12+
};
13+
14+
export enum Severity {
15+
CRITICAL = 'Critical',
16+
WARNING = 'Warning',
17+
INFO = 'Info',
18+
NONE = 'None',
19+
};
20+
21+
export enum Source {
22+
PLATFORM = 'Platform',
23+
USER = 'User',
24+
};
25+
26+
export enum GraphTimespan {
27+
FIVE_MINUTES = '5m',
28+
FIFTEEN_MINUTES = '15m',
29+
THIRTY_MINUTES = '30m',
30+
ONE_HOUR = '1h',
31+
TWO_HOURS = '2h',
32+
SIX_HOURS = '6h',
33+
TWELVE_HOURS = '12h',
34+
ONE_DAY = '1d',
35+
TWO_DAYS = '2d',
36+
ONE_WEEK = '1w',
37+
TWO_WEEKS = '2w',
38+
};
39+
40+
export enum MetricsPageUnits {
41+
NO_UNITS = 'No Units',
42+
BYTES_BINARY = 'Bytes Binary (KiB, MiB)',
43+
BYTES_DECIMAL = 'Bytes Decimal (kb, MB)',
44+
BYTES_BINARY_PER_SECOND = 'Bytes Binary Per Second (KiB/s, MiB/s)',
45+
BYTES_DECIMAL_PER_SECOND = 'Bytes Decimal Per Second (kB/s, MB/s)',
46+
PACKETS_PER_SECOND = 'Packets Per Second',
47+
MILISECONDS = 'Miliseconds',
48+
SECONDS = 'Seconds',
49+
PERCENTAGE = 'Percentage',
50+
};
51+
52+
export enum MetricsPageRefreshInterval {
53+
REFRESH_OFF = 'Refresh off',
54+
FIFTEEN_SECONDS = '15 seconds',
55+
THIRTY_SECONDS = '30 seconds',
56+
ONE_MINUTE = '1 minute',
57+
FIFTEEN_MINUTES = '15 minutes',
58+
ONE_HOUR = '1 hour',
59+
TWO_HOURS = '2 hours',
60+
ONE_DAY = '1 day',
61+
};
62+
63+
export enum MetricsPagePredefinedQueries {
64+
CPU_USAGE = 'CPU Usage',
65+
MEMORY_USAGE = 'Memory Usage',
66+
FILESYSTEM_USAGE = 'Filesystem Usage',
67+
RECEIVE_BANDWIDTH = 'Receive bandwidth',
68+
TRANSMIT_BANDWIDTH = 'Transmit bandwidth',
69+
RATE_OF_RECEIVED_PACKETS = 'Rate of received packets',
70+
RATE_OF_TRANSMITTED_PACKETS = 'Rate of transmitted packets',
71+
RATE_OF_RECEIVED_PACKETS_DROPPED = 'Rate of received packets dropped',
72+
RATE_OF_TRANSMITTED_PACKETS_DROPPED = 'Rate of transmitted packets dropped',
73+
};
74+
75+
export enum MetricsPageQueryInput {
76+
EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES = 'Expression (press Shift+Enter for newlines)',
77+
INSERT_EXAMPLE_QUERY = 'sort_desc(sum(sum_over_time(ALERTS{alertstate="firing"}[24h])) by (alertname))',
78+
VECTOR_QUERY='vector(1)',
79+
CPU_USAGE = 'OpenShift_Metrics_QueryTable_sum(node_namespace_pod_container_container_cpu_usage_seconds_total_sum_irate) by (pod).csv',
80+
MEMORY_USAGE = 'OpenShift_Metrics_QueryTable_sum(container_memory_working_set_bytes{container!=__}) by (pod).csv',
81+
FILESYSTEM_USAGE = 'OpenShift_Metrics_QueryTable_topk(25, sort_desc(sum(pod_container_fs_usage_bytes_sum{container=__,pod!=__}) BY (pod, namespace))).csv',
82+
RECEIVE_BANDWIDTH = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_bytes_total[2h])) by (pod).csv',
83+
TRANSMIT_BANDWIDTH = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_bytes_total[2h])) by (pod).csv',
84+
RATE_OF_RECEIVED_PACKETS = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_total[2h])) by (pod).csv',
85+
RATE_OF_TRANSMITTED_PACKETS = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_total[2h])) by (pod).csv',
86+
RATE_OF_RECEIVED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_dropped_total[2h])) by (pod).csv',
87+
RATE_OF_TRANSMITTED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_dropped_total[2h])) by (pod).csv',
88+
}
89+
90+
export enum MetricsPageActions {
91+
ADD_QUERY = 'Add query',
92+
DELETE_ALL_QUERIES = 'Delete all queries',
93+
EXPAND_ALL_QUERY_TABLES = 'Expand all query tables',
94+
COLLAPSE_ALL_QUERY_TABLES = 'Collapse all query tables',
95+
}
96+
97+
export enum MetricGraphEmptyState {
98+
NO_DATAPOINTS_FOUND = 'No datapoints found.',
99+
NO_QUERY_ENTERED = 'No query entered',
100+
ENTER_QUERY = 'Enter a query in the box below to explore metrics for this cluster.',
101+
UNGRAPHABLE_RESULTS = 'Ungraphable results',
102+
UNGRAPHABLE_RESULTS_DESCRIPTION = 'The resulting dataset is too large to graph.',
103+
}
104+
105+
export enum MetricsPageQueryKebabDropdown{
106+
DISABLE_QUERY = 'Disable query',
107+
ENABLE_QUERY = 'Enable query',
108+
HIDE_ALL_SERIES = 'Hide all series',
109+
SHOW_ALL_SERIES = 'Show all series',
110+
DELETE_QUERY = 'Delete query',
111+
DUPLICATE_QUERY = 'Duplicate query',
112+
EXPORT_AS_CSV = 'Export as CSV',
113+
}

web/cypress/support/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Withinable = Cypress.Withinable;
55
import Shadow = Cypress.Shadow;
66
import 'cypress-wait-until';
77
import { guidedTour } from '../views/tour';
8-
import './nav';
8+
import { nav } from '../views/nav';
99
import { operatorHubPage } from '../views/operator-hub-page';
1010

1111

web/cypress/support/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ export const checkErrors = () =>
66
cy.window().then((win) => {
77
assert.isTrue(!win.windowError, win.windowError);
88
});
9+
10+
Cypress.on('uncaught:exception', (err, runnable) => {
11+
// returning false here prevents Cypress from failing the test
12+
// on a JavaScript exception
13+
if (err.message.includes('ResizeObserver loop completed with undelivered notifications')) {
14+
return false
15+
}
16+
});

web/cypress/views/alerting-rule-details-page.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export const alertingRuleDetailsPage = {
1111
detailsPage.sectionHeaderShouldExist('Active alerts');
1212
cy.byTestID(DataTestIDs.Expression).should('be.visible');
1313
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
14-
cy.get(Classes.GraphCard).should('be.visible');
14+
cy.get(Classes.GraphCard).scrollIntoView().should('be.visible');
15+
cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible');
16+
cy.byTestID(DataTestIDs.MetricGraphTimespanDropdown).should('be.visible');
17+
cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should('be.visible');
18+
cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible');
1519
},
1620

1721
clickOnActiveAlerts: (desc: string) => {

web/cypress/views/details-page.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,4 @@ export const detailsPage = {
114114
cy.log('detailsPage.clickSilenceAlertButton');
115115
cy.byTestID(DataTestIDs.SilenceButton).should('be.visible').click();
116116
},
117-
118-
clickResetZoomButton:()=>{
119-
cy.log('detailsPage.clickResetZoomButton');
120-
cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible').click();
121-
},
122-
123-
clickHideGraphButton:()=>{
124-
cy.log('detailsPage.clickHideGraphButton');
125-
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible').click();
126-
cy.get(Classes.GraphCard).should('not.exist');
127-
},
128-
129-
clickShowGraphButton:()=>{
130-
cy.log('detailsPage.clickShowGraphButton');
131-
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible').click();
132-
cy.get(Classes.GraphCard).should('be.visible');
133-
},
134-
135117
};

web/cypress/views/list-page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { commonPages } from "./common";
21
import { getPFVersion } from "./utils";
32
import { DataTestIDs, Classes, LegacyTestIDs } from "../../src/components/data-test";
43

0 commit comments

Comments
 (0)