CDM Metrics Protocol buffer serialization.

An implementation that serializes metrics to a protocol buffer.

This is a merge from wvgerrit/28440.

I intend to submit 2048751, 2048750, and 2048509 together.

Bug: 36217927
Bug: 36220975
Test: Added unit tests to cover modified code.
Change-Id: Ie8b9d8b91d2602b015f5568890a16c0419c126df
This commit is contained in:
Adam Stone
2017-03-30 10:26:58 -07:00
parent a34e279d0f
commit b851dd8cfd
7 changed files with 706 additions and 19 deletions

View File

@@ -0,0 +1,36 @@
// Copyright 2017 Google Inc. All Rights Reserved.
//
// This file contains a proto definition for serialization of metrics data.
//
syntax = "proto2";
package drm_metrics;
// need this if we are using libprotobuf-cpp-2.3.0-lite
option optimize_for = LITE_RUNTIME;
// The MetricsGroup is a collection of metric name/value pair instances
// that can be serialized and provided to a caller.
message MetricsGroup {
message Metric {
message MetricValue {
// Only one of the following values must be set. Note that the oneof
// keyword is not supported in the protobuf version checked into the CDM.
optional int64 int_value = 1;
optional double double_value = 2;
optional string string_value = 3;
}
// The name of the metric. Must be valid UTF-8. Required.
optional string name = 1;
// The value of the metric. Required.
optional MetricValue value = 2;
}
// The list of name/value pairs of metrics.
repeated Metric metric = 1;
// Allow multiple sub groups of metrics.
repeated MetricsGroup metric_sub_group = 2;
}