blob: bbaf50a83fa92670ffe5b3345f26698a01c5a853 [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
Yao Chend5aa01b32017-12-19 16:46:36 -080019#include "HashableDimensionKey.h"
Yao Chen9c1debe2018-02-19 14:39:19 -080020#include "frameworks/base/cmds/statsd/src/stats_log_common.pb.h"
Chenjie Yud9dfda72017-12-11 17:41:20 -080021#include "logd/LogReader.h"
yro00698da2017-09-15 10:06:40 -070022
Yang Lu3eba6212017-10-25 19:54:45 -070023#include <unordered_map>
24
Yao Chen44cf27c2017-09-14 22:32:50 -070025namespace android {
26namespace os {
27namespace statsd {
yro00698da2017-09-15 10:06:40 -070028
Yangster-mac20877162017-12-22 17:19:39 -080029const HashableDimensionKey DEFAULT_DIMENSION_KEY = HashableDimensionKey();
Yangster-mac93694462018-01-22 20:49:31 -080030const MetricDimensionKey DEFAULT_METRIC_DIMENSION_KEY = MetricDimensionKey();
Yao Chen729093d2017-10-16 10:33:26 -070031
Chenjie Yu85ed8382017-12-14 16:48:54 -080032// Minimum bucket size in seconds
33const long kMinBucketSizeSec = 5 * 60;
34
Yangster-mac94e197c2018-01-02 16:03:03 -080035typedef std::map<int64_t, std::vector<HashableDimensionKey>> ConditionKey;
Yao Chen5154a3792017-10-30 22:57:06 -070036
Yangster-mac93694462018-01-22 20:49:31 -080037typedef std::unordered_map<MetricDimensionKey, int64_t> DimToValMap;
Yang Lu3eba6212017-10-25 19:54:45 -070038
Yao Chen44cf27c2017-09-14 22:32:50 -070039} // namespace statsd
40} // namespace os
41} // namespace android