diff --git a/e2e_tests/pages/dashboards/mysql/index.ts b/e2e_tests/pages/dashboards/mysql/index.ts index 0ee25f7a3..8ab980b7a 100644 --- a/e2e_tests/pages/dashboards/mysql/index.ts +++ b/e2e_tests/pages/dashboards/mysql/index.ts @@ -6,6 +6,7 @@ import PXCGaleraNodesCompare from './pxcGaleraNodesCompare'; import MySQLUserDetails from './mysqlUserDetails'; import MysqlGroupReplicationSummary from './mysqlGroupReplicationSummary'; import MysqlMyRocksDetails from './mysqlMyRocksDetails'; +import MysqlPerformanceSchemaDetails from './mysqlPerformanceSchemaDetails'; import MysqlReplicationSummary from './mysqlReplicationSummary'; import HaproxyInstanceSummary from './haproxyInstanceSummary'; import MysqlWaitEventAnalysesDetails from './mysqlWaitEventAnalysesDetails'; @@ -22,6 +23,7 @@ export const MysqlDashboards = { mysqlInstancesCompare: new MySQLInstancesCompare(), mysqlInstanceSummary: new MysqlInstanceSummary(), mysqlMyRocksDetails: new MysqlMyRocksDetails(), + mysqlPerformanceSchemaDetails: new MysqlPerformanceSchemaDetails(), mysqlReplicationSummary: new MysqlReplicationSummary(), mysqlUserDetails: new MySQLUserDetails(), mysqlWaitEventAnalysesDetails: new MysqlWaitEventAnalysesDetails(), diff --git a/e2e_tests/pages/dashboards/mysql/mysqlPerformanceSchemaDetails.ts b/e2e_tests/pages/dashboards/mysql/mysqlPerformanceSchemaDetails.ts new file mode 100644 index 000000000..7f497f11b --- /dev/null +++ b/e2e_tests/pages/dashboards/mysql/mysqlPerformanceSchemaDetails.ts @@ -0,0 +1,64 @@ +import { GrafanaPanel } from '@interfaces/grafanaPanel'; +import DashboardInterface from '@interfaces/dashboard'; + +export default class MysqlPerformanceSchemaDetails implements DashboardInterface { + url = 'graph/d/mysql-performance-schema/mysql-performance-schema-details'; + // Primary memory panel: mysql_perf_schema_memory_events_used_bytes. Populated whenever + // memory instruments are enabled server-side (default on PS/MySQL 8.0+), so it must + // render real data end-to-end (collector -> VictoriaMetrics -> panel). + memoryCurrentUsedPanel = 'Memory Usage — Current Bytes Used (Top 15 by Event)'; + // Panels added in PMM-12279 (perf_schema.memory_events collector -> memory panels). + // Names are copied verbatim from the dashboard JSON; the first one uses an em dash (U+2014). + memoryMetrics: GrafanaPanel[] = [ + { name: 'Memory Usage — Current Bytes Used (Top 15 by Event)', type: 'timeSeries' }, + { name: 'Memory Allocation Rate (Top 10 by Event)', type: 'timeSeries' }, + { name: 'Memory Free Rate (Top 10 by Event)', type: 'timeSeries' }, + ]; + metrics: GrafanaPanel[] = [ + { name: 'Performance Schema File IO (Events)', type: 'timeSeries' }, + { name: 'Performance Schema File IO (Load)', type: 'timeSeries' }, + { name: 'Performance Schema File IO (Bytes)', type: 'timeSeries' }, + { name: 'Performance Schema Status Variables (Events)', type: 'timeSeries' }, + { name: 'Performance Schema Waits (Events)', type: 'timeSeries' }, + { name: 'Performance Schema Waits (Load)', type: 'timeSeries' }, + { name: 'Index Access Operations (Load)', type: 'timeSeries' }, + { name: 'Table Access Operations (Load)', type: 'timeSeries' }, + { name: 'Performance Schema SQL & External Locks (Events)', type: 'timeSeries' }, + { name: 'Performance Schema SQL and External Locks (Seconds)', type: 'timeSeries' }, + { name: 'MySQL Uptime', type: 'stat' }, + { name: 'Version', type: 'text' }, + { name: 'Current QPS', type: 'stat' }, + { name: 'File Handlers Used', type: 'stat' }, + { name: 'Table Open Cache Miss Ratio', type: 'stat' }, + { name: 'Table Open Cache Size', type: 'stat' }, + { name: 'Table Definition Cache Size', type: 'stat' }, + { name: 'Service', type: 'text' }, + { name: 'MySQL Connections', type: 'timeSeries' }, + { name: 'MySQL Client Thread Activity', type: 'timeSeries' }, + { name: 'MySQL Handlers', type: 'timeSeries' }, + { name: 'Top Command Counters', type: 'timeSeries' }, + { name: 'Process States', type: 'timeSeries' }, + { name: 'MySQL Network Traffic', type: 'timeSeries' }, + { name: 'System Uptime', type: 'stat' }, + { name: 'Load Average', type: 'stat' }, + { name: 'RAM', type: 'stat' }, + { name: 'Memory Available', type: 'stat' }, + { name: 'Virtual Memory', type: 'stat' }, + { name: 'Disk Space', type: 'stat' }, + { name: 'Min Space Available', type: 'stat' }, + { name: 'Node', type: 'text' }, + { name: 'CPU Usage', type: 'timeSeries' }, + { name: 'CPU Saturation and Max Core Usage', type: 'timeSeries' }, + { name: 'Disk I/O and Swap Activity', type: 'timeSeries' }, + { name: 'Network Traffic', type: 'timeSeries' }, + ...this.memoryMetrics, + ]; + // The two rate panels only plot series whose alloc/free rate is > 0, so under low load + // they can legitimately be empty. They are allow-listed here for any full-dashboard + // verifyAllPanelsHaveData() check; the feature test asserts data on memoryCurrentUsedPanel. + noDataMetrics: string[] = [ + 'Memory Allocation Rate (Top 10 by Event)', + 'Memory Free Rate (Top 10 by Event)', + ]; + metricsWithData = this.metrics.filter((metric) => !this.noDataMetrics.includes(metric.name)); +} diff --git a/e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts b/e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts index 39995b7ee..defdf262b 100644 --- a/e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts +++ b/e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts @@ -186,3 +186,29 @@ pmmTest( await dashboard.verifyPanelValues(dashboard.mysql.mysqlMyRocksDetails.metricsWithData); }, ); + +// TODO: replace PMM-T0000 with the Zephyr test-case id reserved for PMM-12279. +pmmTest( + 'PMM-T0000 - Verify Performance Schema Memory panels on MySQL Performance Schema Details Dashboard (PMM-12279) @pmm-ps-integration', + async ({ api, dashboard, page, urlHelper }) => { + const { service_name } = await api.inventoryApi.getServiceDetailsByRegex('ps_pmm'); + + await page.goto( + urlHelper.buildUrlWithParameters(dashboard.mysql.mysqlPerformanceSchemaDetails.url, { + from: 'now-15m', + refresh: '5s', + serviceName: service_name, + }), + ); + + // Feature under test: the "Performance Schema Memory" row and its three panels are present. + await dashboard.verifyMetricsPresent(dashboard.mysql.mysqlPerformanceSchemaDetails.memoryMetrics); + + // End-to-end proof (perf_schema.memory_events collector -> VictoriaMetrics -> panel): + // Current Bytes Used is populated whenever memory instruments are enabled server-side, + // which is the default on PS/MySQL 8.0+, so it must render real data. + await dashboard.verifyNamedPanelsHaveData([ + dashboard.mysql.mysqlPerformanceSchemaDetails.memoryCurrentUsedPanel, + ]); + }, +);