| <!-- |
| Copyright 2024 The Chromium Authors |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <!-- |
| This file is used to generate a comprehensive list of AI histograms |
| along with a detailed description for each histogram. |
| |
| For best practices on writing histogram descriptions, see |
| https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md |
| |
| Please follow the instructions in the OWNERS file in this directory to find a |
| reviewer. If no OWNERS file exists, please consider signing up at |
| go/reviewing-metrics (Googlers only), as all subdirectories are expected to |
| have an OWNERS file. As a last resort you can send the CL to |
| chromium-metrics-reviews@google.com. |
| --> |
| |
| <histogram-configuration> |
| |
| <histograms> |
| |
| <!-- LINT.IfChange(SessionType) --> |
| |
| <variants name="SessionType"> |
| <variant name="LanguageDetector" summary="AI language detector session"/> |
| <variant name="LanguageModel" summary="AI language model session"/> |
| <variant name="Proofreader" summary="AI proofreader session"/> |
| <variant name="Rewriter" summary="AI rewriter session"/> |
| <variant name="Summarizer" summary="AI summarizer session"/> |
| <variant name="Translator" summary="AI translator session"/> |
| <variant name="Writer" summary="AI writer session"/> |
| </variants> |
| |
| <!-- LINT.ThenChange(//third_party/blink/renderer/modules/ai/ai_metrics.h:AISessionType) --> |
| |
| <variants name="WritingAssistanceFunctionName"> |
| <variant name="availability" summary="Check availability of the model."/> |
| <variant name="create" summary="Create a session."/> |
| </variants> |
| |
| <variants name="WritingAssistanceType"> |
| <variant name="Rewriter" summary="AI rewriter session"/> |
| <variant name="Summarizer" summary="AI summarizer session"/> |
| <variant name="Writer" summary="AI writer session"/> |
| </variants> |
| |
| <histogram name="AI.Session.{SessionType}.PromptRequestSize" units="bytes" |
| expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Measures the size of the prompt request in bytes. This is recorded each time |
| when the model is executed. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram name="AI.Session.{SessionType}.PromptResponseCallbackCount" |
| units="times" expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Measures the number of times that the callback is triggered in one prompt |
| request. This is recorded each time when the model execution completes. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram name="AI.Session.{SessionType}.PromptResponseSize" units="bytes" |
| expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Measures the size of the prompt response in bytes. This is recorded each |
| time when the model execution completes. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram name="AI.Session.{SessionType}.PromptResponseStatus" |
| enum="AIModelStreamingResponseStatus" expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Records the final response status for each prompt request. This is recorded |
| each time when the stream completes or encounters errors. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram |
| name="AI.Summarizer.APIUsage.{WritingAssistanceFunctionName}.CoreOptionType" |
| enum="WritingAssistanceMetricsOptionType" expires_after="2025-10-27"> |
| <owner>btriebw@chromium.org</owner> |
| <owner>ayui@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the WritingAssistance function is invoked. |
| It can be used to measure the usage of the `type` option. |
| </summary> |
| <token key="WritingAssistanceFunctionName" |
| variants="WritingAssistanceFunctionName"/> |
| </histogram> |
| |
| <histogram name="AI.Translation.LoadTranslateKitErrorCode" |
| enum="WinGetLastError" expires_after="2025-10-27"> |
| <owner>mych@google.com</owner> |
| <owner>fergal@google.com</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Records the error code of a failed attempt to load the TranslateKit binary |
| for on-device translation. It may happen when browser tries to initialize |
| the OnDeviceTranslationService. This is only logged on Windows. See |
| on_device_translation::TranslateKitClient for more details. |
| </summary> |
| </histogram> |
| |
| <histogram name="AI.Translation.LoadTranslateKitResult" |
| enum="LoadTranslateKitResult" expires_after="2025-10-27"> |
| <owner>mych@google.com</owner> |
| <owner>fergal@google.com</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Records the result of an attempt to load the TranslateKit binary for |
| on-device translation. It is logged when browser tries to initialize the |
| OnDeviceTranslationService. See on_device_translation::TranslateKitClient |
| for more details. |
| </summary> |
| </histogram> |
| |
| <histogram name="AI.{SessionType}.APIUsage" enum="AIAPI" |
| expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the prompt JavaScript API is invoked. This |
| can be used to measure the number of calls of each API within a particular |
| time period. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram name="AI.{SessionType}.AvailabilityV2" enum="Availability" |
| expires_after="2025-10-27"> |
| <owner>leimy@chromium.org</owner> |
| <owner>fergal@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| Records the availability of model execution as returned in methods like |
| `LanguageModel.availability()`. |
| </summary> |
| <token key="SessionType" variants="SessionType"/> |
| </histogram> |
| |
| <histogram |
| name="AI.{WritingAssistanceType}.APIUsage.{WritingAssistanceFunctionName}.CoreOptionFormat" |
| enum="WritingAssistanceMetricsOptionFormat" expires_after="2025-10-27"> |
| <owner>btriebw@chromium.org</owner> |
| <owner>ayui@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the WritingAssistance function is invoked. |
| It can be used to measure the usage of the `format` option. |
| </summary> |
| <token key="WritingAssistanceType" variants="WritingAssistanceType"/> |
| <token key="WritingAssistanceFunctionName" |
| variants="WritingAssistanceFunctionName"/> |
| </histogram> |
| |
| <histogram |
| name="AI.{WritingAssistanceType}.APIUsage.{WritingAssistanceFunctionName}.CoreOptionLength" |
| enum="WritingAssistanceMetricsOptionLength" expires_after="2025-10-27"> |
| <owner>btriebw@chromium.org</owner> |
| <owner>ayui@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the WritingAssistance function is invoked. |
| It can be used to measure the usage of the `length` option. |
| </summary> |
| <token key="WritingAssistanceType" variants="WritingAssistanceType"/> |
| <token key="WritingAssistanceFunctionName" |
| variants="WritingAssistanceFunctionName"/> |
| </histogram> |
| |
| <histogram |
| name="AI.{WritingAssistanceType}.APIUsage.{WritingAssistanceFunctionName}.CoreOptionTone" |
| enum="WritingAssistanceMetricsOptionTone" expires_after="2025-10-27"> |
| <owner>btriebw@chromium.org</owner> |
| <owner>ayui@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the WritingAssistance function is invoked. |
| It can be used to measure the usage of the `tone` option. |
| </summary> |
| <token key="WritingAssistanceType" variants="WritingAssistanceType"/> |
| <token key="WritingAssistanceFunctionName" |
| variants="WritingAssistanceFunctionName"/> |
| </histogram> |
| |
| <histogram |
| name="AI.{WritingAssistanceType}.APIUsage.{WritingAssistanceFunctionName}.{LanguageMetric}" |
| enum="LocaleCodeBCP47" expires_after="2025-10-27"> |
| <owner>btriebw@chromium.org</owner> |
| <owner>ayui@chromium.org</owner> |
| <owner>src/chrome/browser/ai/OWNERS</owner> |
| <summary> |
| This is recorded each time when the WritingAssistance function is invoked. |
| It can be used to measure the usage of the language options. |
| </summary> |
| <token key="WritingAssistanceType" variants="WritingAssistanceType"/> |
| <token key="WritingAssistanceFunctionName" |
| variants="WritingAssistanceFunctionName"/> |
| <token key="LanguageMetric"> |
| <variant name="ExpectedContextLanguage" |
| summary="Expected context language specified."/> |
| <variant name="ExpectedInputLanguage" |
| summary="Expected input language specified."/> |
| <variant name="OutputLanguage" summary="Output language specified."/> |
| </token> |
| </histogram> |
| |
| </histograms> |
| |
| </histogram-configuration> |