blob: 070f50f3f3c58235c4a164c1b75c3457529fb38b [file] [log] [blame]
// 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 EventCodesAggregateData {
repeated uint32 event_codes = 1;
AggregateData data = 2;
}
message EventCodeAggregate {
reserved 1, 3;
// A map from event_codes vector to AggregateData, in order of first arrival
repeated EventCodesAggregateData by_event_code = 4;
// used for metrics of type STRING only. This list should not exceed string_buffer_max entries per
// aggregation period
repeated bytes string_hashes = 2;
}
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;
}