OSDN Git Service

Allow atoms to log fields in bytes format.
authorYao Chen <yaochen@google.com>
Wed, 24 Oct 2018 19:15:56 +0000 (12:15 -0700)
committerJack He <siyuanh@google.com>
Sat, 15 Dec 2018 21:51:08 +0000 (13:51 -0800)
commit8b71c74894462fc68f2ebe551b82615d0cd67184
treeec08fbb4f907b0572f78fa30a45cce2d9e688ec9
parentcb61d10c905f6ca40ae21fd8f0fb7efb4ae90444
Allow atoms to log fields in bytes format.

There are an increasing number of requests to log data in complex format to statsd, while the data
is not expected to be parsed or aggregated by statsd and only to be uploaded as events.

Instead of making an exception for each of these cases in a hard coded way, this CL add a feature to
annotate these field in atoms.proto and the stats-log-api-gen tool will produce byte array
interfaces for them.

Note that log_msg does not have byte array type, and only has string type, when statsd receives the
log, these fields are in string type. Only when the atom is written to proto, we will check if this
field should be bytes field and write it to protobuf in message format.

Change-Id: If53dd95c5826710c76d7fe982bf951a435dfc738
Merged-In: If53dd95c5826710c76d7fe982bf951a435dfc738
Fix: 118386797
Bug: 120635548
Test: unit test & manual test
(cherry picked from commit bbdd67d19f4912fbec00220b22e44c68eff5ab3f)
cmds/statsd/src/atom_field_options.proto
cmds/statsd/src/stats_log_util.cpp
tools/stats_log_api_gen/Collation.cpp
tools/stats_log_api_gen/Collation.h
tools/stats_log_api_gen/main.cpp
tools/stats_log_api_gen/test.proto
tools/stats_log_api_gen/test_collation.cpp