main.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. var perfjankie = require('perfjankie');
  2. var run = process.env.COMMIT || 'commit#Hash'; // A hash for the commit, displayed in the x-axis in the dashboard
  3. var time = process.env.DATE || new Date().getTime() // Used to sort the data when displaying graph. Can be the time when a commit was made
  4. var scenario = process.env.ACTIONS || '90-nodes-select';
  5. var host = process.env.HOST || 'localhost:4040';
  6. var actions = require('../actions/' + scenario)({host: host, run: run});
  7. perfjankie({
  8. /* The next set of values identify the test */
  9. suite: 'Scope',
  10. name: scenario, // A friendly name for the URL. This is shown as component name in the dashboard
  11. time: time,
  12. run: run,
  13. repeat: 10, // Run the tests 10 times. Default is 1 time
  14. /* Identifies where the data and the dashboard are saved */
  15. couch: {
  16. server: 'http://local.docker:5984',
  17. database: 'performance'
  18. // updateSite: !process.env.CI, // If true, updates the couchApp that shows the dashboard. Set to false in when running Continuous integration, run this the first time using command line.
  19. // onlyUpdateSite: false // No data to upload, just update the site. Recommended to do from dev box as couchDB instance may require special access to create views.
  20. },
  21. callback: function(err, res) {
  22. if (err)
  23. console.log(err);
  24. // The callback function, err is falsy if all of the following happen
  25. // 1. Browsers perf tests ran
  26. // 2. Data has been saved in couchDB
  27. // err is not falsy even if update site fails.
  28. },
  29. /* OPTIONS PASSED TO BROWSER-PERF */
  30. // Properties identifying the test environment */
  31. browsers: [{ // This can also be a ['chrome', 'firefox'] or 'chrome,firefox'
  32. browserName: 'chrome',
  33. chromeOptions: {
  34. perfLoggingPrefs: {
  35. 'traceCategories': 'toplevel,disabled-by-default-devtools.timeline.frame,blink.console,disabled-by-default-devtools.timeline,benchmark'
  36. },
  37. args: ['--enable-gpu-benchmarking', '--enable-thread-composting']
  38. },
  39. loggingPrefs: {
  40. performance: 'ALL'
  41. }
  42. }], // See browser perf browser configuration for all options.
  43. actions: actions,
  44. selenium: {
  45. hostname: 'local.docker', // or localhost or hub.browserstack.com
  46. port: 4444,
  47. }
  48. });