speedracer / speedracer Goto Github PK
View Code? Open in Web Editor NEWCollect performance metrics for your library/application.
License: MIT License
Collect performance metrics for your library/application.
License: MIT License
Hello!
I'm running speedracer under Linux, and for some reason Chrome fails to open port 9222 for debugging if I don't use sudo. The problem is that speedracer actually outputs the issue:
chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
(at least with debug output enabled) but doesn't stop after that. Here's the sample output:
DEBUG=* speedracer run race.js
chrome-launcher locate chrome +0ms
chrome-launcher trying: /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary +0ms
chrome-launcher auto locate chrome +1ms
chrome-launcher chrome found: /usr/bin/google-chrome +8ms
chrome-launcher spawn chrome with flags: --headless,--remote-debugging-port=9222,--disable-gpu,--disable-translate,--disable-extensions,--disable-background-networking,--safebrowsing-disable-auto-update,--disable-sync,--metrics-recording-only,--disable-default-apps,--no-first-run,--user-data-dir=/tmp,--js-flags="--expose-gc" +1ms
chrome-launcher check debugger ready: 1 +2ms
chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
chrome-launcher check debugger ready: 2 +501ms
chrome-launcher chrome ready +1ms
server start server +0ms
server listening on port: 3000 +3ms
server serving directory: /home/speedracer +0ms
runner-server listening on port: 3001 +0ms
driver load file race.js +38ms
director file loaded: race.js +114ms
director no races found: race.js +3s
I assume stopping at failures like that and outputting them in non-debug mode could potentially save some time for other users. Thanks in advance!
Currently, race
creates two artifacts (a trace and a report) as files, but it's not possible to associate the race and the artifacts programmatically.
In order to automate perf testing (mostly based on reports), I'd love that the artifacts are passed as a result of the race
function (in a Promise). Something like:
describe('Prime number finder', () => {
it('should run under 10s for a 6 digits prime', () => {
return race('prime race', () => prime(6))
.then((report, trace) => {
assert(report.profiling.functions.prime < 10000)
})
});
})
Note: In this use case, the first argument of the race()
function is not useful, so my 2c would be to move it as second argument, and make it optional. Also, in this use case, I don't need the artifacts as files.
What do you think of this use case / syntax?
I'm trying to import a JS file I want to test, but when I do and I run speedracer run
it always says 0 races No races found in perf/DateTimePicker.perf.js.
. When I remove the additional import it says 1 race
.
My code:
import race from 'speedracer'
import DateTimePicker, { validateDate } from './DateTimePicker'
race('my first race', () => {
console.log('RACEEE')
})
chrome: 58
os: macOS 10.12.4
trace:
๐ Speed Racer v0.1.2
โฏ Starting
โ Launching headless browser
โ Chrome Debugger could not be reached.
Starting tracing server
Tracing
Reporting
Error: Chrome Debugger could not be reached.
at isDebuggerReady.then.isReady (/usr/local/lib/node_modules/speedracer/lib/launch-chrome.js:74:27)
at process._tickCallback (internal/process/next_tick.js:109:7)
Let me know if you need more info.
My ultimate goal for Speed Racer is to build a perf runner that will achieve different purposes:
Here is the associated roadmap (subject to change):
show
command, that displays reports like 0.1.x
version.run
commandtest
command 30e9611
compare
command, compare several reports between them.Feedback welcomed ๐
/cc @paulirish @samccone
nicely done, now please build a SaaS around it so I don't have to, then sell to Adobe and live a happy life.
We can also use puppeteer instead of downloading Chromium manually.
Hi, awesome project! I noticed you seem to be reusing chrome launcher from lighthouse, is there anything I can do to help you migrate to using it directly?
Thanks!
Windows 10.
Code is the high cpu example from the fixtures directory.
Speedracer finds the file in /perf and appears to be running, but then:
0 races
faster n/a
slowest n/a
No races found in perf/index.js
Thanks
Hi ,
Is there any documentation you can help me with please where i can get the meaning and units of each metric that we get in the following report?
{ "meta": { "title": "render 60 frames", "group": "test-fixtures-multiple", "id": "render-60-frames" }, "profiling": { "categories": { "scripting": 13.217000007629395, "rendering": 11.370999991893768, "painting": 9.248999938368797 }, "events": { "Animation Frame Fired": 7.994999974966049, "Composite Layers": 7.0119999796152115, "Update Layer Tree": 6.503000020980835, "JS Frame": 5.1060000360012054, "Recalculate Style": 4.867999970912933, "Paint": 2.236999958753586, "Run Microtasks": 0.11599999666213989 }, "functions": { "FireAnimationFrame": 7.994999974966049, "CompositeLayers": 7.0119999796152115, "UpdateLayerTree": 6.503000020980835, "UpdateLayoutTree": 4.867999970912933, "f:render@24": 2.32600000500679, "Paint": 2.236999958753586, "f:requestAnimationFrame@": 2.1010000109672546, "f:ws.onmessage@24": 0.1940000057220459, "f:finishRace@24": 0.15600000321865082, "f:@": 0.1300000101327896, "RunMicrotasks": 0.11599999666213989, "f:Promise@": 0.10099999606609344, "f:startRace@24": 0.09800000488758087 } }, "rendering": { "firstPaint": 0.00805, "fps": { "mean": 60.98, "variance": 3.9, "sd": 1.97, "lo": 56.92, "hi": 63.47 } } }
It seems the Travis integration is not working anymore.
I've tried all of the provided examples but speedracer always fails to run races with a message similar to the following:
โ 0 races
๐ fastest n/a
slowest n/a
โ No races found in high-cpu.js.
Hi! Cool project ๐
When i first started to play with this, couldn't get it to work. I just got "no races found in ...".
Then i checked with debug logging, and the issue was that the default port 3000
was in use.
What do you think of defaulting to a random port using get-port ?
Are there any reason you'd want to know the port?
If not, it should at least throw an error and quit if the port is in use ๐
โฏ speedracer run
โ 0 races
๐ fastest n/a
slowest n/a
โ No races found in perf/index.js.
โจ Done in 4.02s.
With DEBUG=*
...
server start server +1ms
server server error: Error: listen EADDRINUSE :::3000 +3ms
runner-server listening on port: 3001 +1ms
driver load file perf/index.js +40ms
director file loaded: perf/index.js +13ms
director no races found: perf/index.js +3s
โจ Done in 4.06s.
I can make a pr when you know how you want to solve this :)
Just found this gem via npm- tried installing and running but it seems like ms
is missing from package.json
0.3.0
will offer a way to integrate SR in a classic development workflow. The aim of this version is to provide an easy way to track any performance regression.
A new command will be introduced: test
. It will act like the run
command but for a different purpose: see if all races are as fast or faster than before.
In order to achieve this, we'll introduce the concept of snapshots for SR. Like test runners offering a snapshot feature, SR will create and save a report snapshot for each race on the first run. Subsequent runs will compare new reports with their snapshot and display appropriate results.
If the new report is as fast or faster, the test is considered as passed. If not, a diff will be displayed and the test
command will return a non-zero error code.
The visual diff should be clear enough to highlight the parts where the run has been slower. Because reports are a DSL, we'll use an in-house diffing/display mechanism instead of a general purpose one (i.e. jest-snapshot).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.