• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7option optimize_for = LITE_RUNTIME;
8
9package metrics.structured;
10
11import "structured_data.proto";
12
13// These protos are used for storing key and event information for structured
14// metrics. All changes should be backwards-compatible. This file is manually
15// synced between chromium and platform2. Any changes should first be made to
16// chromium and then copied to platform2.
17//
18// chromium path: components/metrics/structured/storage.proto
19// platform2 path: metrics/structured/proto/storage.proto
20
21// All information about the key for a single project.
22message KeyProto {
23  // The key itself.
24  optional string key = 1;
25
26  // When the key was last rotated, in days since the unix epoch.
27  optional int64 last_rotation = 2;
28
29  // The maximum number of days between rotations.
30  optional int64 rotation_period = 3;
31}
32
33// Stores keys for all projects.
34message KeyDataProto {
35  // Maps the first 8 bytes of the MD5 hash of the project name to that
36  // project's key.
37  map<fixed64, KeyProto> keys = 1;
38}
39
40// On-device storage for events that have been recorded but not yet uploaded.
41message EventsProto {
42  // Events not associated with the UMA client_id.
43  repeated StructuredEventProto non_uma_events = 1;
44
45  // Events associated with the UMA client_id.
46  repeated StructuredEventProto uma_events = 2;
47}
48