Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Teach browsertime to collect Gecko internal PerfStats #10

Open
ncalexan opened this issue May 31, 2019 · 3 comments
Open

Teach browsertime to collect Gecko internal PerfStats #10

ncalexan opened this issue May 31, 2019 · 3 comments

Comments

@ncalexan
Copy link
Member

Over in Bug 1553254, a new micro-benchmark Gecko API is being implemented. This ticket tracks teaching browsertime to enable that API and to collect the resulting data.

@ncalexan
Copy link
Member Author

The WIP I have is in ncalexan@687bf81.

@hawkinsw
Copy link

The WIP (very, very early!) is in a5ab734

@hawkinsw
Copy link

A new-style script would look something like

({
  'requiredPrivs': ['privilege'],
  'function': (function() {
  const measures = [];
  const marks = [];

  if (window.performance && window.performance.getEntriesByType) {
    const myMarks = Array.prototype.slice.call(
      window.performance.getEntriesByType('mark')
    );

    for (const mark of myMarks) {
      marks.push({
        name: mark.name,
        startTime: mark.startTime
      });
    }

    const myMeasures = Array.prototype.slice.call(
      window.performance.getEntriesByType('measure')
    );

    for (const measure of myMeasures) {
      measures.push({
        name: measure.name,
        duration: measure.duration,
        startTime: measure.startTime
      });
    }
  }

  return {
    marks: marks,
    measures: measures
  };
})
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants