yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 1 | /* |
| 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 Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 16 | |
| 17 | #pragma once |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 18 | |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 19 | #include "logd/LogReader.h" |
| 20 | #include "storage/DropboxWriter.h" |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 21 | |
| 22 | #include <log/logprint.h> |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 23 | #include "frameworks/base/cmds/statsd/src/statsd_config.pb.h" |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 24 | |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 25 | #include <unordered_map> |
| 26 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 27 | namespace android { |
| 28 | namespace os { |
| 29 | namespace statsd { |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 30 | |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 31 | #define DEFAULT_DIMENSION_KEY "" |
| 32 | #define MATCHER_NOT_FOUND -2 |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 33 | |
| 34 | typedef std::string HashableDimensionKey; |
| 35 | |
Yao Chen | 5154a379 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 36 | typedef std::map<std::string, HashableDimensionKey> ConditionKey; |
| 37 | |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame^] | 38 | typedef std::unordered_map<HashableDimensionKey, int64_t> DimToValMap; |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 39 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 40 | EventMetricData parse(log_msg msg); |
| 41 | |
| 42 | int getTagId(log_msg msg); |
| 43 | |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 44 | std::string getHashableKey(std::vector<KeyValuePair> key); |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame^] | 45 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 46 | } // namespace statsd |
| 47 | } // namespace os |
| 48 | } // namespace android |