Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory allocation to plan output if provided by Neo4j #1111

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions e2e_tests/integration/plan.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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({
Expand Down