forked from Marklogic-retired/marklogic-data-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Marklogic-retired#208 in PROD/explorer-ui from ~DN…
…ICHOLS/explorer-ui:performance to develop * commit 'b735a0bdedbd27a1b89de54a2af8f439d47424ff': DHFPROD-3775: New performance reports added. DHFPROD-3775: New performance reports added.
- Loading branch information
Showing
11 changed files
with
159 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const puppeteer = require('puppeteer'); | ||
const testPage = require('./' + process.argv.slice(2)[0]); | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch({ignoreHTTPSErrors: true, headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']}); | ||
const page = await browser.newPage() | ||
|
||
//await page.setCacheEnabled(false) | ||
const navigationPromise = page.waitForNavigation({ | ||
waitUntil: 'networkidle0', | ||
}); | ||
|
||
await page.goto('https://rh7v-10-dhf-stress-1:8443', { waitUntil: 'domcontentloaded' }); | ||
process.on('unhandledRejection', error => { | ||
console.log('unhandledRejection', error.message); | ||
}); | ||
|
||
new Promise((_, reject) => reject(new Error('error'))). | ||
catch(error => { | ||
console.log('caught', err.message); | ||
}); | ||
|
||
await page.setViewport({ width: 1916, height: 997 }) | ||
|
||
await navigationPromise | ||
|
||
|
||
await page.waitForSelector('.ant-col #username') | ||
await page.click('.ant-col #username') | ||
|
||
await page.type('.ant-col #username', 'admin') | ||
|
||
await page.waitForSelector('.ant-col #password') | ||
await page.click('.ant-col #password') | ||
|
||
await page.type('.ant-col #password', 'admin') | ||
|
||
await page.waitForSelector('.ant-row #submit') | ||
await page.click('.ant-row #submit') | ||
|
||
await page.waitFor(5000) | ||
await page.goto('https://rh7v-10-dhf-stress-1:8443/browse', { waitUntil: 'domcontentloaded' }) | ||
console.log(await testPage(page)); | ||
|
||
console.log("\n==== performance.getEntries() ====\n"); | ||
console.log( | ||
await page.evaluate( () => | ||
JSON.stringify(performance.getEntries(), null, " ") | ||
) | ||
); | ||
|
||
console.log("\n==== performance.toJSON() ====\n"); | ||
console.log( | ||
await page.evaluate( () => | ||
JSON.stringify(performance.toJSON(), null, " ") | ||
) | ||
); | ||
|
||
console.log("\n==== page.metrics() ====\n"); | ||
const perf = await page.metrics(); | ||
console.log( | ||
JSON.stringify(perf, null, " ") | ||
); | ||
|
||
console.log("\n==== Devtools: Performance.getMetrics ====\n"); | ||
let performanceMetrics = await page._client.send('Performance.getMetrics'); | ||
console.log( performanceMetrics.metrics ); | ||
|
||
await browser.close() | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
echo "Running: Browse Docs" | ||
node index.js browseDocs.js > browseDoc_timing | ||
echo "Running: Search" | ||
node index.js search.js > search_timing | ||
echo "Running: Collections" | ||
node index.js collections.js > collection_timing | ||
echo "Running: Steps" | ||
node index.js steps.js > steps_timing | ||
echo "Running: Flows" | ||
node index.js flows.js > flows_timing | ||
echo "Running: All Facets" | ||
node index.js allFacets.js > allFacets_timing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { extractDataFromPerformanceTiming } = require('./perfHelper'); | ||
|
||
async function search(page) { | ||
|
||
await page.waitForSelector('[class*=search-bar_searchInput] > .ant-input-search > .ant-input-wrapper > .ant-input-search > .ant-input') | ||
await page.click('[class*=search-bar_searchInput] > .ant-input-search > .ant-input-wrapper > .ant-input-search > .ant-input') | ||
|
||
await page.waitFor(3000) | ||
await page.type('[class*=search-bar_searchInput] > .ant-input-search > .ant-input-wrapper > .ant-input-search > .ant-input', 'the') | ||
|
||
await page.waitFor(2000) | ||
await page.click('[class*=search-bar_searchInput] > .ant-input-search > .ant-input-wrapper > .ant-input-group-addon > .ant-btn') | ||
|
||
} | ||
|
||
module.exports = search; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters