Giter Site home page Giter Site logo

Comments (9)

soulgalore avatar soulgalore commented on June 17, 2024 1

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.

soulgalore avatar soulgalore commented on June 17, 2024 1

Hmm I looked at the current code and I think it needs some refactoring to work (looking at the stop function).

from browsertime.

soulgalore avatar soulgalore commented on June 17, 2024 1

Hi @92kns sounds good, open a PR and we can work out the details.

from browsertime.

soulgalore avatar soulgalore commented on June 17, 2024

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.

92kns avatar 92kns commented on June 17, 2024

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.

92kns avatar 92kns commented on June 17, 2024

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

const commands = {

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.

92kns avatar 92kns commented on June 17, 2024

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.

92kns avatar 92kns commented on June 17, 2024

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.

92kns avatar 92kns commented on June 17, 2024

Can probably close this now

from browsertime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.