| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto3"; |
| |
| package cobalt; |
| |
| import "src/pb/observation.proto"; |
| |
| // An Event is the unit of data logged in Cobalt. |
| // |
| // Events are associated with a specific Metric. There is a different Event |
| // type for each Metric type. Events are also tagged with a day index indicating |
| // the day on which the event occurred. |
| message Event { |
| // An Event has one of the following types. These types correspond to |
| // the various Metric types defined in config/metric_definitions.proto. |
| oneof type { |
| OccurrenceEvent occurrence_event = 8; |
| IntegerEvent integer_event = 9; |
| IntegerHistogramEvent integer_histogram_event = 10; |
| StringEvent string_event = 11; |
| } |
| |
| // The three-part unique numerical identifier of the Metric that this |
| // Event is associated with. |
| uint32 customer_id = 1000; |
| uint32 project_id = 1001; |
| uint32 metric_id = 1002; |
| |
| // The index of the day on which this Event occurred. |
| uint32 day_index = 1003; |
| // The hour id for this Event. |
| uint32 hour_id = 1005; |
| |
| reserved 1, 2, 3, 4, 5, 6, 7, 999; |
| } |
| |
| // Records that an event occurred a number of times. |
| message OccurrenceEvent { |
| // The event codes for the event that occurred. There must be one event code |
| // given for each dimension specified in the metric definition. |
| repeated uint32 event_code = 1; |
| // The number of times the event occurred. |
| uint64 count = 2; |
| } |
| |
| // Records that an event occurred a number of times. |
| message IntegerEvent { |
| // The event codes for the event that occurred. There must be one event code |
| // given for each dimension specified in the metric definition. |
| repeated uint32 event_code = 1; |
| // The elapsed time in microseconds. |
| int64 value = 2; |
| } |
| |
| // Records a frame-rate. |
| message StringEvent { |
| // The event codes for the event that occurred. There must be one event code |
| // given for each dimension specified in the metric definition. |
| repeated uint32 event_code = 1; |
| // The associated system component |
| string string_value = 2; |
| } |
| |
| // Records a histogram over a set of integer buckets. The semantics of the |
| // Metric must be specified in comments near the Metric definition. The |
| // numerical values of the buckets is specified in the |int_buckets| |
| // field of the MetricDefinition. |
| message IntegerHistogramEvent { |
| // The event codes for the event that occurred. There must be one event code |
| // given for each dimension specified in the metric definition. |
| repeated uint32 event_code = 1; |
| // The set of bucket indices and their corresponding counts. |
| repeated HistogramBucket buckets = 3; |
| } |