<!--
Copyright 2020 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 GCM 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>

<histogram name="GCM.AccountMappingMessageReceived" enum="BooleanReceived"
    expires_after="2022-01-02">
  <owner>peter@chromium.org</owner>
  <owner>knollr@chromium.org</owner>
  <summary>
    Records that a message has been received from a delivery channel powered by
    the GCM account mappings.
  </summary>
</histogram>

<histogram name="GCM.CheckinRequestStatus" enum="GCMCheckinRequestStatus"
    expires_after="2023-11-12">
  <owner>peter@chromium.org</owner>
  <owner>knollr@chromium.org</owner>
  <summary>Status code of the outcome of a GCM checkin request.</summary>
</histogram>

<histogram name="GCM.CheckinRequestStatusNetError" enum="NetErrorCodes"
    expires_after="M98">
  <owner>peter@chromium.org</owner>
  <owner>knollr@chromium.org</owner>
  <summary>
    Network error code for a GCM checkin request that failed because of a
    network error.
  </summary>
</histogram>

<histogram name="GCM.ClientStartDelay" units="ms" expires_after="2024-09-14">
  <owner>rushans@google.com</owner>
  <owner>peter@chromium.org</owner>
  <summary>
    Records the time for which GCM client start task has been delayed. Recorded
    whenever GCM client is requested to start.
  </summary>
</histogram>

<histogram name="GCM.Crypto.DecryptMessageResult" enum="GCMDecryptionResult"
    expires_after="never">
<!-- expires-never: Used to monitor push encryption and debug issues. -->

  <owner>peter@chromium.org</owner>
  <owner>zea@chromium.org</owner>
  <summary>
    Result of decryption on a received GCM message, which includes unencrypted
    messages, successfully decrypted messages and decryption failures.
  </summary>
</histogram>

<histogram name="GCM.Crypto.RemoveKeySuccessRate" enum="BooleanSuccess"
    expires_after="M94">
  <owner>peter@chromium.org</owner>
  <owner>zea@chromium.org</owner>
  <summary>
    Success rate of removing keying material from the GCM key store.
  </summary>
</histogram>

<histogram name="GCM.Database.Open" enum="LevelDBStatus" expires_after="never">
<!-- expires-never: core storage metric; consumed in separate dashboard (go/chrome-storage-dashboard) -->

  <owner>dmurph@chromium.org</owner>
  <owner>pwnall@chromium.org</owner>
  <owner>peter@chromium.org</owner>
  <summary>The result of a database open attempt by the GCM store.</summary>
</histogram>

<histogram name="GCM.DelayedTaskControlledReadyTime" units="ms"
    expires_after="2024-09-14">
  <owner>rushans@google.com</owner>
  <owner>peter@chromium.org</owner>
  <summary>
    Records the time for which tasks in GCM driver were delayed. Recorded once
    GCM driver is ready (normally this means that GCM client is initialized).
  </summary>
</histogram>

<histogram name="GCM.DeliveredToAppHandler{AppHandler}" enum="BooleanDelivered"
    expires_after="2024-02-20">
  <owner>peter@chromium.org</owner>
  <owner>rushans@google.com</owner>
  <summary>
    Whether a received GCM message could be delivered to an app handler
    ({AppHandler}). Recorded for each received GCM message that didn't have
    encryption issues. This metric was expired between July 2021 and January
    2023, and may be missing data until M111.
  </summary>
  <token key="AppHandler">
    <variant name="" summary="all handlers"/>
    <variant name=".FcmInvalidations" summary="FCM invalidations"/>
    <variant name=".SyncInvalidations" summary="Sync standalone invalidations"/>
  </token>
</histogram>

<histogram name="GCM.LoadStatus" enum="GCMLoadStatus" expires_after="M98">
  <owner>peter@chromium.org</owner>
  <owner>knollr@chromium.org</owner>
  <summary>Status code of loading from the persistent GCM store.</summary>
</histogram>

<histogram name="GCM.PendingConnectionEventsAtShutdown" units="events"
    expires_after="M98">
  <owner>peter@chromium.org</owner>
  <owner>knollr@chromium.org</owner>
  <summary>
    Number of connection events which have not been sent to GCM. This is
    recorded only at the time of shutdown to capture the events which are being
    lost due to shutdown. Because this is recorded at shutdown, this is not
    guaranteed to be complete and should be treated as a best effort record.
  </summary>
</histogram>

<histogram name="GCM.RegistrationCacheStatus" enum="GCMRegistrationCacheStatus"
    expires_after="2023-04-16">
  <owner>nator@chromium.org</owner>
  <owner>peter@chromium.org</owner>
  <owner>rayankans@chromium.org</owner>
  <summary>
    Reports the status of cached GCM registration. This is recorded when a new
    registration request is considered on the GCM client.
  </summary>
</histogram>

<histogram name="GCM.RegistrationRequest" units="requests"
    expires_after="2023-04-16">
  <owner>peter@chromium.org</owner>
  <summary>
    Number of registration requests sent to Google Cloud Messaging. Recorded
    immediately after the request has started.
  </summary>
</histogram>

<histogram name="GCM.RegistrationRequest.NetErrorCode" enum="NetErrorCodes"
    expires_after="2023-04-16">
  <owner>peter@chromium.org</owner>
  <owner>platform-capabilities@chromium.org</owner>
  <summary>
    Net error code from a GCM registration attempt. Recorded when URL loading
    completes.
  </summary>
</histogram>

<histogram name="GCM.RegistrationRequestStatus"
    enum="GCMRegistrationRequestStatus" expires_after="2024-02-25">
  <owner>peter@chromium.org</owner>
  <summary>
    Status code of the outcome of a GCM registration request. The Unknown error
    case was split up in M56 (merged mid-beta to M55) to separate out the
    Response parsing failed, Internal server error, Quota exceeded, and Device
    has too many registrations cases.
  </summary>
</histogram>

<histogram name="GCM.SendWebPushMessageResult" enum="SendWebPushMessageResult"
    expires_after="2024-03-17">
  <owner>knollr@chromium.org</owner>
  <owner>peter@chromium.org</owner>
  <summary>
    Result of sending web push messages. Recorded when the message has either
    been sent, or has been dropped because an error happened.
  </summary>
</histogram>

<histogram name="GCM.StoreSizeKB" units="KB" expires_after="2022-01-16">
  <owner>peter@chromium.org</owner>
  <owner>rayankans@chromium.org</owner>
  <summary>
    Size of the GCM persistent store in kilobytes at startup. Warning: this
    histogram was expired from 2018-08-30 to 2021-09-20; data may be missing.
  </summary>
</histogram>

<histogram name="GCM.StoreUpdateSucceeded" enum="BooleanSuccess"
    expires_after="2018-08-30">
  <owner>zea@chromium.org</owner>
  <summary>
    Success indicates successfully updating the GCM persistent store on message
    update. Failure indicates a failure updating the persistence store.
  </summary>
</histogram>

<histogram name="GCM.UnregistrationRequestStatus"
    enum="GCMUnregistrationRequestStatus" expires_after="M88">
  <owner>peter@chromium.org</owner>
  <owner>zea@chromium.org</owner>
  <summary>Status code of the outcome of a GCM unregistration request.</summary>
</histogram>

<histogram name="GCM.UserSignedIn" enum="Boolean" expires_after="2021-03-28">
  <owner>jianli@chromium.org</owner>
  <summary>
    Indicates whether the user was signed in when GCM started up.
  </summary>
</histogram>

<histogram name="GCM.WebPushReceived.DeviceState" enum="WebPushDeviceState"
    expires_after="2022-01-02">
  <owner>knollr@chromium.org</owner>
  <owner>peter@chromium.org</owner>
  <summary>
    Device state when receiving a web push message. Indicates if the message was
    sent with a high priority and if the device was in idle mode. Recorded when
    a web push message got received.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
