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 | |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 19 | #include <sstream> |
Yao Chen | d5aa01b3 | 2017-12-19 16:46:36 -0800 | [diff] [blame] | 20 | #include "HashableDimensionKey.h" |
| 21 | #include "frameworks/base/cmds/statsd/src/stats_log.pb.h" |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 22 | #include "logd/LogReader.h" |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 23 | |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 24 | #include <unordered_map> |
| 25 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 26 | namespace android { |
| 27 | namespace os { |
| 28 | namespace statsd { |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 29 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 30 | const HashableDimensionKey DEFAULT_DIMENSION_KEY = HashableDimensionKey(); |
Yangster-mac | 9369446 | 2018-01-22 20:49:31 -0800 | [diff] [blame] | 31 | const MetricDimensionKey DEFAULT_METRIC_DIMENSION_KEY = MetricDimensionKey(); |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 32 | |
Chenjie Yu | 85ed838 | 2017-12-14 16:48:54 -0800 | [diff] [blame] | 33 | // Minimum bucket size in seconds |
| 34 | const long kMinBucketSizeSec = 5 * 60; |
| 35 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 36 | typedef std::map<int64_t, std::vector<HashableDimensionKey>> ConditionKey; |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 37 | |
Yangster-mac | 9369446 | 2018-01-22 20:49:31 -0800 | [diff] [blame] | 38 | typedef std::unordered_map<MetricDimensionKey, 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 | } // namespace statsd |
| 41 | } // namespace os |
| 42 | } // namespace android |