Skip to content

Commit

Permalink
Bug 1766516 - add about:profiling thread checkboxes for java. r=canal…
Browse files Browse the repository at this point in the history
…tinova,fluent-reviewers,flod

I tried to pick thread groups that are part of GeckoView (Gecko), might be
common to GeckoView products (Nimbus), and the Android ecosystem (Kotlin
coroutines) instead of threads that are fenix-specific.

Differential Revision: https://phabricator.services.mozilla.com/D144753
  • Loading branch information
mcomella committed May 18, 2022
1 parent f845ff0 commit ed553c5
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
13 changes: 13 additions & 0 deletions devtools/client/locales/en-US/perftools.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ perftools-heading-features-default = Features (Recommended on by default)
perftools-heading-features-disabled = Disabled Features
perftools-heading-features-experimental = Experimental
perftools-heading-threads = Threads
perftools-heading-threads-jvm = JVM Threads
perftools-heading-local-build = Local build
##
Expand Down Expand Up @@ -95,6 +96,18 @@ perftools-thread-dns-resolver =
.title = DNS resolution happens on this thread
perftools-thread-task-controller =
.title = TaskController thread pool threads
perftools-thread-jvm-gecko =
.title = The main Gecko JVM thread
perftools-thread-jvm-nimbus =
.title = The main threads for the Nimbus experiments SDK
perftools-thread-jvm-default-dispatcher =
.title = The Default dispatcher for the Kotlin coroutines library
perftools-thread-jvm-glean =
.title = The main threads for the Glean telemetry SDK
perftools-thread-jvm-arch-disk-io =
.title = The IO dispatcher for the Kotlin coroutines library
perftools-thread-jvm-pool =
.title = Threads created in an unnamed thread pool
##

Expand Down
60 changes: 60 additions & 0 deletions devtools/client/performance-new/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,46 @@ const threadColumns = [
],
];

/** @type {Array<ThreadColumn[]>} */
const jvmThreadColumns = [
[
{
name: "Gecko",
id: "gecko",
l10nId: "perftools-thread-jvm-gecko",
},
{
name: "Nimbus",
id: "nimbus",
l10nId: "perftools-thread-jvm-nimbus",
},
],
[
{
name: "DefaultDispatcher",
id: "default-dispatcher",
l10nId: "perftools-thread-jvm-default-dispatcher",
},
{
name: "Glean",
id: "glean",
l10nId: "perftools-thread-jvm-glean",
},
],
[
{
name: "arch_disk_io",
id: "arch-disk-io",
l10nId: "perftools-thread-jvm-arch-disk-io",
},
{
name: "pool-",
id: "pool",
l10nId: "perftools-thread-jvm-pool",
},
],
];

/**
* This component manages the settings for recording a performance profile.
* @extends {React.PureComponent<Props, State>}
Expand Down Expand Up @@ -311,6 +351,7 @@ class Settings extends PureComponent {
this._renderThreadsColumns(threadDisplay, index)
)
),
this._renderJvmThreads(),
div(
{
className: "perf-settings-checkbox-label perf-settings-all-threads",
Expand Down Expand Up @@ -361,6 +402,25 @@ class Settings extends PureComponent {
);
}

_renderJvmThreads() {
if (!this.props.supportedFeatures.includes("java")) {
return null;
}

return [
h2(
null,
Localized({ id: "perftools-heading-threads-jvm" }, "JVM Threads")
),
div(
{ className: "perf-settings-thread-columns" },
jvmThreadColumns.map((threadDisplay, index) =>
this._renderThreadsColumns(threadDisplay, index)
)
),
];
}

/**
* @param {React.ReactNode} sectionTitle
* @param {FeatureDescription[]} features
Expand Down

0 comments on commit ed553c5

Please sign in to comment.