Comments (9)
Hi @92kns sounds good. I was thinking maybe start/stop would be enough since we need to turn it on with the command line. I think I could do it and expose chrome profiling the same way maybe.
from browsertime.
Hmm I looked at the current code and I think it needs some refactoring to work (looking at the stop function).
from browsertime.
Hi @92kns sounds good, open a PR and we can work out the details.
from browsertime.
Hi @92kns when you do need the profiler to end? This is how the page complete check works: https://www.sitespeed.io/documentation/sitespeed.io/browsers/#choose-when-to-end-your-test - the idea is that when that signals that the test is over, we shutdown gecko profiler and the same functionality for Chrome, then we start to run the JavaScript metrics (we run JS to collect metrics from the browser). So either if you can define when you want to end the test or if I you need collect data after the test, we need to add some kind configuration/switch for that.
from browsertime.
Thanks for the speedy response and for the link, that gives me a better idea of the sequence of events.
when you do need the profiler to end?
it varies depending on the benchmark but I think having the option to keep the profiler running for even an extra 5-10 seconds would be a good start. So I tried playing around with --pageCompleteWaitTime
and that seemed to increase the profiler run time! (but made other things slow - I need to play around with it a bit more 😅 )
inadvertently, this also helped me find an issue with another benchmark (it seems to consistently only trigger after the gecko profiler stops, no matter how long I increased --pageCompleteWaitTime
)
Anyway, thanks for your help. I will let you know as soon as I can if we've resolved the issue and can close this ticket, or if I need some more help!
from browsertime.
Hi @soulgalore we were thinking of exposing the geckoprofiler through the commands
so that we might be manually control the .start()/.stop() ourselves
e.g. adding it here
browsertime/lib/core/engine/iteration.js
Line 156 in 081d93e
and potentially adding another flag like --firefox.customgeckoprofiler
maybe? which would control whether it is exposed or not
would you have any objects/thoughts to something like this?
from browsertime.
Awesome, thanks for taking a quick look!
I was thinking maybe start/stop would be enough
just to clarify only expose the start/stop rather than the profiler object itself like I had initially suggested? That makes a lot more sense.
So then your suggestion could look something like this ( modified snippet from iteration.js)?:
...
let browserProfilerStart = null;
let browserProfilerStop = null;
if (browser.options.browser == 'firefox') {
const browserProfiler = new GeckoProfiler(
browser,
this.storageManager,
this.options.firefox,
this.options
);
browserProfilerStart = () => browserProfiler.start();
browserProfilerStop = () => browserProfiler.stop();
} // extend this to chrome trace later
const cdp = new ChromeDevelopmentToolsProtocol(
engineDelegate,
options.browser
);
const android = new Android(options);
const debug = new Debug(browser, options);
const commands = {
browserProfilerStart: browserProfilerStart,
browserProfilerStop: browserProfilerStop,
...
...
(something like this so far lets me manually control the start(), I have not yet taken a look at the refactoring required for stop() but I will do that next and see how that goes)
from browsertime.
Hi @soulgalore
Something like this seems to work for us at the moment:
main...92kns:browsertime:expose_gp
it is convenient to be able to call commands.profiler.start()/stop() in our own scripts, when using a new geckoProfilerCustom
flag.
I didn't really refactor the geckoprofiler stop() command though, except for automatically setting the index/url
What do you think? I can open a PR soon after I double check some things
from browsertime.
Can probably close this now
from browsertime.
Related Issues (20)
- Debug mode is currently broken for desktop HOT 1
- Add GitHub action test for --debug HOT 1
- Chromedriver 115 do not find Chrome HOT 1
- StopWatch and custom metrics associated with wrong URL-or-alias HOT 3
- Checks invoking extraWait() ignore --pageCompleteCheckStartWait, always take default 5000ms minimum HOT 7
- Does browsertime support DoT or DoH? HOT 1
- Use node directly to get test indicators HOT 8
- Hope to support the version of commonjs specification HOT 1
- How to collect fetch/xhr requests in the network HOT 2
- Selenium console.log message when you run tests with Safari HOT 1
- Chrome 119+ fails to start HOT 1
- Implement support for soft navigations in Chrome(ium)
- Support SPA navigations that do not do any requests
- linux failed to start chorme three times HOT 2
- When testing multiple URLs, the cache of previous URLs will not be obtained and will not interfere with each other. HOT 11
- Firefox 121 on Mac OS (14.2) fails to start HOT 2
- When runMultiple is running, will the script execution time in preScript and postScript be counted in the recorded time? HOT 2
- Add types to https://github.com/DefinitelyTyped/DefinitelyTyped
- Firefox on Android always runs power usage tests HOT 2
- Implement Long Animation Frame HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browsertime.