blob: b7d8f97afaae05273789dfb3869a09cca4726c08 [file] [log] [blame]
yro00698da2017-09-15 10:06:40 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Yang Lu3eba6212017-10-25 19:54:45 -070016
17#pragma once
yro00698da2017-09-15 10:06:40 -070018
Joe Onorato9fc9edf2017-10-15 20:08:52 -070019#include "logd/LogReader.h"
20#include "storage/DropboxWriter.h"
yro00698da2017-09-15 10:06:40 -070021
22#include <log/logprint.h>
Yao Chencaf339d2017-10-06 16:01:10 -070023#include "frameworks/base/cmds/statsd/src/statsd_config.pb.h"
yro00698da2017-09-15 10:06:40 -070024
Yang Lu3eba6212017-10-25 19:54:45 -070025#include <unordered_map>
26
Yao Chen44cf27c2017-09-14 22:32:50 -070027namespace android {
28namespace os {
29namespace statsd {
yro00698da2017-09-15 10:06:40 -070030
Yao Chen729093d2017-10-16 10:33:26 -070031#define DEFAULT_DIMENSION_KEY ""
32#define MATCHER_NOT_FOUND -2
Yao Chen729093d2017-10-16 10:33:26 -070033
34typedef std::string HashableDimensionKey;
35
Yao Chen5154a3792017-10-30 22:57:06 -070036typedef std::map<std::string, HashableDimensionKey> ConditionKey;
37
Yangster-mace2cd6d52017-11-09 20:38:30 -080038typedef std::unordered_map<HashableDimensionKey, int64_t> DimToValMap;
Yang Lu3eba6212017-10-25 19:54:45 -070039
Yao Chen44cf27c2017-09-14 22:32:50 -070040EventMetricData parse(log_msg msg);
41
42int getTagId(log_msg msg);
43
Yao Chen729093d2017-10-16 10:33:26 -070044std::string getHashableKey(std::vector<KeyValuePair> key);
Yangster-mace2cd6d52017-11-09 20:38:30 -080045
Yao Chen44cf27c2017-09-14 22:32:50 -070046} // namespace statsd
47} // namespace os
48} // namespace android