Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e07967e
🔃 Daily sync: main -> l10n (May 18, 2024)
May 18, 2024
bd9d520
🔃 Daily sync: main -> l10n (May 22, 2024)
May 22, 2024
07b78f6
Only count markers that are part of the selected range when hovering …
fqueze May 22, 2024
c3df72b
🔃 Daily sync: main -> l10n (May 23, 2024)
May 23, 2024
81e5883
Update all Yarn dependencies (2024-05-22) (#5008)
depfu[bot] May 23, 2024
720a43b
⬆️ Update flow-typed to version 4.0.0 (#5001)
depfu[bot] May 23, 2024
90a6e98
Pontoon: Update Chinese (China) (zh-CN) localization of Firefox Profiler
Olvcpr423 May 23, 2024
3bc654e
🔃 Daily sync: main -> l10n (May 24, 2024)
May 24, 2024
6867528
⬆️ Update fake-indexeddb to version 5.0.2
depfu[bot] Feb 26, 2024
dd8cfac
Add flow libdef for the core-js package
canova Feb 26, 2024
b0f490f
Import structuredClone from core-js where needed
canova Feb 26, 2024
579e273
Update fake-indexeddb 4.0.2 → 5.0.2 (major) (#4877)
canova May 30, 2024
5ac4665
⬆️ Update fake-indexeddb to version 6.0.0 (#5011)
depfu[bot] May 30, 2024
144ea2d
🔃 Daily sync: main -> l10n (May 31, 2024)
May 31, 2024
b382cc1
Update github handle from AdamHarries to AdamBrouwersHarries
AdamBrouwersHarries May 30, 2024
920ef03
Merge branch 'main' into adam-icon
canova May 31, 2024
5d3ecae
Update github handle from AdamHarries to AdamBrouwersHarries (#5014)
AdamBrouwersHarries May 31, 2024
15336cc
Bump requests from 2.31.0 to 2.32.0 in /taskcluster (#5003)
dependabot[bot] May 31, 2024
f908c4e
🔃 Daily sync: main -> l10n (June 1, 2024)
Jun 1, 2024
ee83710
Add sanitized-string format (#5007)
valenting Jun 4, 2024
f347d48
Merge branch 'main' into l10n
julienw Jun 4, 2024
fa0aca9
🔃 Sync: l10n -> main (June 4, 2024) (#5015)
julienw Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ First off, thanks for taking the time to contribute to Mozilla and the Firefox P

This project is made up of a cross section of different parts of Mozilla, including people from Firefox DevTools and from Firefox's platform team who are working on the C++ and Rust internals of Firefox. Some core Mozillians on the team are:

| - | Name | Github Handle | Position |
| ------------------------------------------------------------------------------------------ | ------------------ | ---------------------------------------------- | -------------------------------------- |
| ![][julienw] | Julien Wajsberg | [@julienw](https://github.com/julienw) | Firefox Frontend Engineer |
| ![][canova] | Nazim Can Altinova | [@canova](https://github.com/canova) | Firefox Platform and Frontend Engineer |
| <img src="https://avatars.githubusercontent.com/mstange?size=56" width="56" height="56" /> | Markus Stange | [@mstange](https://github.com/mstange) | Firefox Platform Engineer |
| ![][AdamHarries] | Adam Harries | [@AdamHarries](https://github.com/AdamHarries) | Firefox Platform Engineer |
| ![][davehunt] | Dave Hunt | [@davehunt](https://github.com/davehunt) | Firefox Profiler Team Manager |
| - | Name | Github Handle | Position |
| ------------------------------------------------------------------------------------------ | ------------------ | -------------------------------------------------------------- | -------------------------------------- |
| ![][julienw] | Julien Wajsberg | [@julienw](https://github.com/julienw) | Firefox Frontend Engineer |
| ![][canova] | Nazim Can Altinova | [@canova](https://github.com/canova) | Firefox Platform and Frontend Engineer |
| <img src="https://avatars.githubusercontent.com/mstange?size=56" width="56" height="56" /> | Markus Stange | [@mstange](https://github.com/mstange) | Firefox Platform Engineer |
| ![][AdamBrouwersHarries] | Adam Harries | [@AdamBrouwersHarries](https://github.com/AdamBrouwersHarries) | Firefox Platform Engineer |
| ![][davehunt] | Dave Hunt | [@davehunt](https://github.com/davehunt) | Firefox Profiler Team Manager |

<!-- mstange's image is differently inserted because its size isn't properly controlled by the size parameter, strangely -->

[mstange]: https://avatars.githubusercontent.com/mstange?size=56
[julienw]: https://avatars.githubusercontent.com/julienw?size=56
[canova]: https://avatars.githubusercontent.com/canova?size=56
[davehunt]: https://avatars.githubusercontent.com/davehunt?size=56
[AdamHarries]: https://avatars.githubusercontent.com/AdamHarries?size=56
[AdamBrouwersHarries]: https://avatars.githubusercontent.com/AdamBrouwersHarries?size=56

We're friendly and we're on the [Mozilla Matrix instance](https://chat.mozilla.org/) in the [_Firefox Profiler_ channel (_#profiler:mozilla.org_)](https://chat.mozilla.org/#/room/#profiler:mozilla.org). Come chat with us if you have any questions about the project.

Expand Down
8 changes: 8 additions & 0 deletions docs-developer/CHANGELOG-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Note that this is not an exhaustive list. Processed profile format upgraders can

## Processed profile format

### Version 49

A new `sanitized-string` marker schema format type has been added, allowing markers to carry arbitrary strings containing PII that will be sanitized along with URLs and FilePaths.

### Version 48

Removed the 'sampleGroups' object from the Counter structure.
Expand Down Expand Up @@ -70,6 +74,10 @@ Older versions are not documented in this changelog but can be found in [process

## Gecko profile format

### Version 30

A new `sanitized-string` marker schema format type has been added, allowing markers to carry arbitrary strings containing PII that will be sanitized along with URLs and FilePaths.

### Version 29

Removed the 'sample_groups' object from the GeckoCounter structure.
Expand Down
15 changes: 15 additions & 0 deletions locales/zh-CN/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,21 @@ TrackPower--tooltip-power-watt = { $value } W
# $value (String) - the power value at this location
TrackPower--tooltip-power-milliwatt = { $value } mW
.label = 功率
# This is used in the tooltip when the power value uses the kilowatt unit.
# Variables:
# $value (String) - the power value at this location
TrackPower--tooltip-average-power-kilowatt = { $value } kW
.label = 当前选择范围内的平均功耗
# This is used in the tooltip when the power value uses the watt unit.
# Variables:
# $value (String) - the power value at this location
TrackPower--tooltip-average-power-watt = { $value } W
.label = 当前选择范围内的平均功耗
# This is used in the tooltip when the instant power value uses the milliwatt unit.
# Variables:
# $value (String) - the power value at this location
TrackPower--tooltip-average-power-milliwatt = { $value } mW
.label = 当前选择范围内的平均功耗
# This is used in the tooltip when the energy used in the current range uses the
# kilowatt-hour unit.
# Variables:
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"classnames": "^2.5.1",
"common-tags": "^1.8.2",
"copy-to-clipboard": "^3.3.3",
"core-js": "^3.37.0",
"core-js": "^3.37.1",
"escape-string-regexp": "^4.0.0",
"gecko-profiler-demangle": "^0.3.3",
"idb": "^8.0.0",
Expand Down Expand Up @@ -133,13 +133,13 @@
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-testing-library": "^6.2.2",
"espree": "^10.0.1",
"fake-indexeddb": "^4.0.2",
"fake-indexeddb": "^6.0.0",
"fetch-mock-jest": "^1.5.1",
"file-loader": "^6.2.0",
"flow-bin": "^0.96.0",
"flow-coverage-report": "^0.8.0",
"flow-typed": "^3.9.0",
"glob": "^10.3.12",
"flow-typed": "^4.0.0",
"glob": "^10.3.15",
"html-webpack-plugin": "^5.6.0",
"husky": "^4.3.8",
"jest": "^29.7.0",
Expand All @@ -156,9 +156,9 @@
"postcss-loader": "^8.1.1",
"prettier": "^3.2.5",
"raw-loader": "^4.0.2",
"rimraf": "^5.0.5",
"rimraf": "^5.0.7",
"style-loader": "^4.0.0",
"stylelint": "^16.4.0",
"stylelint": "^16.5.0",
"stylelint-config-idiomatic-order": "^10.0.0",
"stylelint-config-standard": "^36.0.0",
"webpack": "^5.91.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app-logic/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type { MarkerPhase } from 'firefox-profiler/types';
// The current version of the Gecko profile format.
// Please don't forget to update the gecko profile format changelog in
// `docs-developer/CHANGELOG-formats.md`.
export const GECKO_PROFILE_VERSION = 29;
export const GECKO_PROFILE_VERSION = 30;

// The current version of the "processed" profile format.
// Please don't forget to update the processed profile format changelog in
// `docs-developer/CHANGELOG-formats.md`.
export const PROCESSED_PROFILE_VERSION = 48;
export const PROCESSED_PROFILE_VERSION = 49;

// The following are the margin sizes for the left and right of the timeline. Independent
// components need to share these values.
Expand Down
46 changes: 39 additions & 7 deletions src/components/marker-chart/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import type {
UnitIntervalOfProfileRange,
ThreadsKey,
Marker,
MarkerTiming,
MarkerTimingAndBuckets,
MarkerIndex,
TimelineTrackOrganization,
Expand Down Expand Up @@ -543,22 +544,53 @@ class MarkerChartCanvasImpl extends React.PureComponent<Props> {
}

countMarkersInBucketStartingAtRow(rowIndex: number): number {
const { markerTimingAndBuckets } = this.props;
const {
rangeStart,
rangeEnd,
markerTimingAndBuckets,
marginLeft,
marginRight,
viewport: { containerWidth, viewportLeft, viewportRight },
} = this.props;
// Decide the time range for which markers should be counted.
const markerContainerWidth = containerWidth - marginLeft - marginRight;
const rangeLength: Milliseconds = rangeEnd - rangeStart;
const viewportLength: UnitIntervalOfProfileRange =
viewportRight - viewportLeft;
const timeAtViewportLeft: Milliseconds =
rangeStart + rangeLength * viewportLeft;
const timeAtViewportRightPlusMargin: Milliseconds =
rangeStart +
rangeLength * viewportRight +
// This represents the amount of seconds in the right margin:
marginRight * ((viewportLength * rangeLength) / markerContainerWidth);

const markerTiming = markerTimingAndBuckets[rowIndex];
if (typeof markerTiming === 'string') {
return 0;
}

const { name } = markerTiming;
let count = markerTiming.length;
function countMarkersInRange(markerTiming: MarkerTiming): number {
let count: number = 0;
for (let i = 0; i < markerTiming.length; i++) {
if (
markerTiming.end[i] >= timeAtViewportLeft &&
markerTiming.start[i] < timeAtViewportRightPlusMargin
) {
++count;
}
}

return count;
}
let count = countMarkersInRange(markerTiming);
for (let row = rowIndex + 1; row < markerTimingAndBuckets.length; ++row) {
if (
typeof markerTimingAndBuckets[row] === 'string' ||
markerTimingAndBuckets[row].name !== name
) {
const markerTiming = markerTimingAndBuckets[row];
if (typeof markerTiming === 'string' || markerTiming.name !== name) {
break;
}
count += markerTimingAndBuckets[row].length;
count += countMarkersInRange(markerTiming);
}
return count;
}
Expand Down
7 changes: 7 additions & 0 deletions src/profile-logic/gecko-profile-versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,13 @@ const _upgraders = {
}
convertToVersion29Recursive(profile);
},
[30]: (_) => {
// This version bump added a new marker schema format type, named "sanitized-string",
// which older frontends will not be able to display.
// No upgrade is needed, as older versions of firefox would not generate
// marker data with sanitized-string typed data, and no modification is needed in the
// frontend to display older formats.
},

// If you add a new upgrader here, please document the change in
// `docs-developer/CHANGELOG-formats.md`.
Expand Down
5 changes: 5 additions & 0 deletions src/profile-logic/marker-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,11 @@ export function sanitizeFromMarkerSchema(
...markerPayload,
[key]: removeFilePath(markerPayload[key]),
}: any);
} else if (format === 'sanitized-string') {
markerPayload = ({
...markerPayload,
[key]: '<sanitized>',
}: any);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/profile-logic/marker-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export function formatFromMarkerSchema(
switch (format) {
case 'url':
case 'file-path':
case 'sanitized-string':
case 'string':
// Make sure a non-empty string is returned here.
return String(value) || '(empty)';
Expand Down
3 changes: 3 additions & 0 deletions src/profile-logic/processed-profile-versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -2264,6 +2264,9 @@ const _upgraders = {
}
}
},
[49]: (_) => {
// The 'sanitized-string' marker schema format type has been added.
},
// If you add a new upgrader here, please document the change in
// `docs-developer/CHANGELOG-formats.md`.
};
Expand Down
4 changes: 4 additions & 0 deletions src/test/fixtures/mocks/indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function resetIndexedDb() {
}

export function autoMockIndexedDB() {
// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
require('core-js/stable/structured-clone');

// This require has a side-effect that's not possible to have with a function
// call, and that we want to happen only when calling autoMockIndexedDB.
// That's why we require it instead of importing.
Expand Down
4 changes: 2 additions & 2 deletions src/test/store/__snapshots__/profile-view.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,15 @@ Object {
"oscpu": "",
"physicalCPUs": 0,
"platform": "",
"preprocessedProfileVersion": 48,
"preprocessedProfileVersion": 49,
"processType": 0,
"product": "Firefox",
"sourceURL": "",
"stackwalk": 0,
"startTime": 0,
"symbolicated": true,
"toolkit": "",
"version": 29,
"version": 30,
},
"pages": Array [
Object {
Expand Down
3 changes: 3 additions & 0 deletions src/test/store/symbolication.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import { formatTree, formatStack } from '../fixtures/utils';
import { assertSetContainsOnly } from '../fixtures/custom-assertions';
import { ensureExists } from 'firefox-profiler/utils/flow';

// fake-indexeddb no longer includes a structuredClone polyfill, so we need to
// import it explicitly.
import 'core-js/stable/structured-clone';
import { indexedDB, IDBKeyRange } from 'fake-indexeddb';
import { stripIndent } from 'common-tags';
import { SymbolsNotFoundError } from '../../profile-logic/errors';
Expand Down
Loading