| // Copyright 2020 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.local_aggregation; |
| |
| message GlobalAggregates { |
| map<uint32, CustomerAggregates> by_customer_id = 1; |
| } |
| |
| message CustomerAggregates { |
| map<uint32, ProjectAggregates> by_project_id = 1; |
| } |
| |
| message ProjectAggregates { |
| map<uint32, MetricAggregate> by_metric_id = 1; |
| } |
| |
| message MetricAggregate { |
| uint32 version = 1; |
| |
| // Map from report_id to ReportAggregate |
| map<uint32, ReportAggregate> by_report_id = 2; |
| } |
| |
| message ReportAggregate { |
| oneof time_period { |
| DailyAggregate daily = 1; |
| HourlyAggregate hourly = 2; |
| } |
| } |
| |
| message DailyAggregate { |
| // Map from day_index to EventCodeAggregate |
| map<uint32, EventCodeAggregate> by_day_index = 1; |
| |
| // The last day index this report has generated observations for |
| uint32 last_day_index = 2; |
| } |
| |
| message HourlyAggregate { |
| // Map from hour_id to EventCodeAggregate |
| map<uint32, EventCodeAggregate> by_hour_id = 1; |
| |
| // The last hour id this report has generated observations for |
| uint32 last_hour_id = 2; |
| } |
| |
| message EventCodeAggregate { |
| // A map from packed event_codes vector to AggregateData |
| map<uint32, AggregateData> by_event_code = 1; |
| |
| // used for metrics of type STRING only. This list should not exceed string_buffer_max entries per |
| // aggregation period |
| repeated bytes string_hashes = 2; |
| |
| // The first |event_code_buffer_max| packed event vectors which were logged for the time |
| // window of this EventCodeAggregate, in order of first arrival. |
| repeated uint32 event_vectors = 3; |
| } |
| |
| message AggregateData { |
| oneof aggregate_data { |
| uint32 count = 1; |
| bool at_least_once = 2; |
| SumAndCount sum_and_count = 3; |
| int64 integer_value = 4; |
| IntegerValues integer_values = 5; |
| IntegerHistogram integer_histogram = 6; |
| StringHistogram string_histogram = 7; |
| } |
| } |
| |
| message SumAndCount { |
| int64 sum = 1; |
| uint32 count = 2; |
| } |
| |
| message IntegerValues { |
| repeated int64 value = 1; |
| } |
| |
| message IntegerHistogram { |
| map<uint32, sint64> histogram = 1; |
| } |
| |
| message StringHistogram { |
| map<uint32, sint64> histogram = 2; |
| } |