diff --git a/e2e_tests/integration/plan.spec.js b/e2e_tests/integration/plan.spec.js index 904d6653743..9b9069e5217 100644 --- a/e2e_tests/integration/plan.spec.js +++ b/e2e_tests/integration/plan.spec.js @@ -29,14 +29,12 @@ describe('Plan output', () => { .should('include', 'Neo4j Browser') cy.wait(3000) cy.disableEditorAutocomplete() + const password = Cypress.config('password') + cy.connect('neo4j', password) }) after(function() { cy.enableEditorAutocomplete() }) - it('can connect', () => { - const password = Cypress.config('password') - cy.connect('neo4j', password) - }) it('displays the expanded details by default and displays/hides details when clicking the plan expand/collapse buttons respectively', () => { cy.executeCommand(':clear') cy.executeCommand( @@ -69,6 +67,18 @@ describe('Plan output', () => { el.should('contain', 'Ordered by n.age ASC') }) } + if (Cypress.config('serverVersion') >= 4.1) { + it('print total memory in PROFILE', () => { + cy.executeCommand(':clear') + cy.executeCommand('CREATE INDEX ON :Person(age)') + cy.executeCommand( + 'PROFILE MATCH (n:Person) WHERE n.age > 18 RETURN n.name ORDER BY n.age' + ) + cy.get('[data-testid="planExpandButton"]', { timeout: 10000 }).click() + cy.get('.global-memory').should('contain', 'total memory (bytes)') + cy.get('.operator-memory').should('contain', 'memory (bytes)') + }) + } if ( Cypress.config('serverVersion') >= 3.4 && Cypress.config('serverVersion') < 4.0 && diff --git a/src/browser/modules/D3Visualization/lib/visualization/components/queryPlan.js b/src/browser/modules/D3Visualization/lib/visualization/components/queryPlan.js index da9f8c0bc70..0ac3800a26f 100644 --- a/src/browser/modules/D3Visualization/lib/visualization/components/queryPlan.js +++ b/src/browser/modules/D3Visualization/lib/visualization/components/queryPlan.js @@ -25,7 +25,7 @@ function queryPlan(element) { const maxComparableRows = 1000000 // link widths are comparable between plans if all operators are below this row count const maxComparableDbHits = 1000000 // db hits are comparable between plans if all operators are below this db hit count - const operatorWidth = 180 + const operatorWidth = 220 const operatorCornerRadius = 4 const operatorHeaderHeight = 18 const operatorHeaderFontSize = 11 @@ -184,6 +184,20 @@ function queryPlan(element) { wordWrap(`Ordered by ${operator.Order}`, 'order') details.push({ className: 'padding' }) } + if (operator.GlobalMemory) { + details.push({ + className: 'global-memory', + key: 'total memory (bytes)', + value: formatNumber(operator.GlobalMemory) + }) + } + if (operator.Memory) { + details.push({ + className: 'operator-memory', + key: 'memory (bytes)', + value: formatNumber(operator.Memory) + }) + } if (operator.PageCacheHits || operator.PageCacheMisses) { details.push({