[Persist] Record diff metrics for TabPersistentStore observer events [chromium/src : main]

0 views
Skip to first unread message

Calder Kitagawa (Gerrit)

unread,
10:21 AM (8 hours ago) 10:21 AM
to Fiaz Muhammad, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org
Attention needed from Fiaz Muhammad

Calder Kitagawa added 5 comments

Commit Message
Line 9, Patchset 7 (Latest):- Record the diff between time required to reach specific auth. and
Calder Kitagawa . unresolved

Please use authoritative. I keep thinking authentication.

File chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/TabPersistenceStoreMetricsTracker.java
Line 44, Patchset 7 (Latest): private void onStoreInitialized() {
Long authoritativeDuration = mAuthoritativeObserver.getInitializedDuration();
Long shadowDuration = mShadowObserver.getInitializedDuration();
if (authoritativeDuration == null || shadowDuration == null) return;

long diff = authoritativeDuration - shadowDuration;
if (diff > 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.Initialized.AuthoritativeLonger", diff);
} else if (diff < 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.Initialized.ShadowLonger", -diff);
}
}
Calder Kitagawa . unresolved

I suspect comparing these between arms will not be meaningful because the initialization order is different and one always happens first due to the shadow/authoritative always being created in a specific relative order. Rather than a diff I think we should record the timestamp this happens at relative to app startup for each store independently.

Line 64, Patchset 7 (Latest): long diff = authoritativeDuration - shadowDuration;
Calder Kitagawa . unresolved

Given my comment below I think we should just independently record the durations of initialization for each i.e. the delta between start and load.

Line 59, Patchset 7 (Latest): private void onStoreStateLoaded() {
Long authoritativeDuration = mAuthoritativeObserver.getStateLoadedDuration();
Long shadowDuration = mShadowObserver.getStateLoadedDuration();
if (authoritativeDuration == null || shadowDuration == null) return;

long diff = authoritativeDuration - shadowDuration;
if (diff > 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.StateLoaded.AuthoritativeLonger", diff);
} else if (diff < 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.StateLoaded.ShadowLonger", -diff);
}

mAuthoritativeStore.removeObserver(mAuthoritativeObserver);
mShadowStore.removeObserver(mShadowObserver);
}
Calder Kitagawa . unresolved

Comparing these things will not be apples to apples. One of the stores will create tabs and the other will not. The work to create tabs is the bulk of the time.

We can compare 1:1 between the same type of experiment arms (since authoritative will always create tabs), but it will never be valid to compare between the shadow and authoritative store.

File tools/metrics/histograms/metadata/tab/histograms.xml
Line 3653, Patchset 7 (Latest): [Android] Records the duration delta for the {Stage} event between the
authoritative and shadow stores when the respective store took longer.
Recorded when both stores have reached the {Stage} event.
Calder Kitagawa . unresolved

If you agree with my comments I'd recommend rewriting this description.

Open in Gerrit

Related details

Attention is currently required from:
  • Fiaz Muhammad
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I49a9c19db89171302ddc7d02a45f5f1727f3f83d
Gerrit-Change-Number: 7453767
Gerrit-PatchSet: 7
Gerrit-Owner: Fiaz Muhammad <mf...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Fiaz Muhammad <mf...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Fiaz Muhammad <mf...@google.com>
Gerrit-Comment-Date: Mon, 12 Jan 2026 15:21:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Fiaz Muhammad (Gerrit)

unread,
10:26 AM (8 hours ago) 10:26 AM
to Chromium LUCI CQ, Calder Kitagawa, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org
Attention needed from Calder Kitagawa

Fiaz Muhammad voted and added 1 comment

Votes added by Fiaz Muhammad

Auto-Submit+1

1 comment

Commit Message
Line 9, Patchset 7:- Record the diff between time required to reach specific auth. and
Calder Kitagawa . resolved

Please use authoritative. I keep thinking authentication.

Fiaz Muhammad

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Calder Kitagawa
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I49a9c19db89171302ddc7d02a45f5f1727f3f83d
Gerrit-Change-Number: 7453767
Gerrit-PatchSet: 8
Gerrit-Owner: Fiaz Muhammad <mf...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Fiaz Muhammad <mf...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Comment-Date: Mon, 12 Jan 2026 15:26:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Calder Kitagawa <ckit...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Fiaz Muhammad (Gerrit)

unread,
10:59 AM (8 hours ago) 10:59 AM
to Chromium LUCI CQ, Calder Kitagawa, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org
Attention needed from Calder Kitagawa

Fiaz Muhammad voted and added 1 comment

Votes added by Fiaz Muhammad

Auto-Submit+0

1 comment

File chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/TabPersistenceStoreMetricsTracker.java
Line 59, Patchset 7: private void onStoreStateLoaded() {

Long authoritativeDuration = mAuthoritativeObserver.getStateLoadedDuration();
Long shadowDuration = mShadowObserver.getStateLoadedDuration();
if (authoritativeDuration == null || shadowDuration == null) return;

long diff = authoritativeDuration - shadowDuration;
if (diff > 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.StateLoaded.AuthoritativeLonger", diff);
} else if (diff < 0) {
RecordHistogram.recordTimesHistogram(
"Tabs.TabStateStore.LoadTimeDelta.StateLoaded.ShadowLonger", -diff);
}

mAuthoritativeStore.removeObserver(mAuthoritativeObserver);
mShadowStore.removeObserver(mShadowObserver);
}
Calder Kitagawa . unresolved

Comparing these things will not be apples to apples. One of the stores will create tabs and the other will not. The work to create tabs is the bulk of the time.

We can compare 1:1 between the same type of experiment arms (since authoritative will always create tabs), but it will never be valid to compare between the shadow and authoritative store.

Fiaz Muhammad

This is fair. I'm likely just going to abandon this CL, I agree that diffing them isn't a good metric.

I think it makes more sense to do add the metrics you mentioned in your earlier comment when we plan to make the TabStateStore authoritative. Then comparing the new implementation to the old one would actually be meaningful.

Gerrit-Comment-Date: Mon, 12 Jan 2026 15:59:15 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Fiaz Muhammad (Gerrit)

unread,
10:59 AM (8 hours ago) 10:59 AM
to Chromium LUCI CQ, Calder Kitagawa, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org

Fiaz Muhammad abandoned this change.

View Change

Abandoned

Fiaz Muhammad abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages