豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 3e1f3a5

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
[Console Insights Teasers] UMA for teaser generation time
Bug: 443644665 Change-Id: Id0a8ca6f8fa5b97371d2d3362cdeacf6d4129966 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7079053 Auto-Submit: Wolfgang Beyer <wolfi@chromium.org> Commit-Queue: Wolfgang Beyer <wolfi@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
1 parent 350807c commit 3e1f3a5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

front_end/core/host/UserMetrics.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ export class UserMetrics {
312312
InspectorFrontendHostInstance.recordEnumeratedHistogram(
313313
EnumeratedHistogram.BuiltInAiAvailability, availability, BuiltInAiAvailability.MAX_VALUE);
314314
}
315+
316+
consoleInsightTeaserGenerated(timeInMilliseconds: number): void {
317+
InspectorFrontendHostInstance.recordPerformanceHistogram(
318+
'DevTools.Insights.TeaserGenerationTime', timeInMilliseconds);
319+
}
315320
}
316321

317322
/**

front_end/panels/console/ConsoleInsightTeaser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
346346
this.#headerText = this.#consoleViewMessage.toMessageTextString().substring(0, 70);
347347
this.#isGenerating = true;
348348
this.#timeoutId = setTimeout(this.#setSlow.bind(this), SLOW_GENERATION_CUTOFF_MILLISECONDS);
349+
const startTime = performance.now();
349350
let teaserText = '';
350351
try {
351352
for await (const chunk of this.#getOnDeviceInsight()) {
@@ -366,6 +367,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
366367
}
367368

368369
clearTimeout(this.#timeoutId);
370+
Host.userMetrics.consoleInsightTeaserGenerated(performance.now() - startTime);
369371
this.#isGenerating = false;
370372
this.#mainText = teaserText;
371373
this.requestUpdate();

0 commit comments

Comments
 (0)