Reorganize the stats directory
[folly.git] / folly / stats / Histogram.cpp
1 /*
2  * Copyright 2017 Facebook, Inc.
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  */
16
17 /*
18  * This file contains explicit instantiations of stats template types.
19  *
20  * This allows most users to avoid having to include the template definition
21  * header files.
22  */
23
24 #include <folly/stats/Histogram.h>
25 #include <folly/stats/Histogram-defs.h>
26
27 namespace folly {
28
29 template class Histogram<int64_t>;
30 template class detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>;
31
32 // Histogram::getPercentileBucketIdx(), Histogram::getPercentileEstimate()
33 // and Histogram::computeTotalCount()
34 // are implemented using template methods.  Instantiate the default versions of
35 // these methods too, so anyone using them won't also need to explicitly
36 // include Histogram-defs.h
37 template size_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>::
38     getPercentileBucketIdx<Histogram<int64_t>::CountFromBucket>(
39         double pct,
40         Histogram<int64_t>::CountFromBucket countFromBucket,
41         double* lowPct,
42         double* highPct) const;
43 template int64_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>
44   ::getPercentileEstimate<Histogram<int64_t>::CountFromBucket,
45                           Histogram<int64_t>::AvgFromBucket>(
46     double pct,
47     Histogram<int64_t>::CountFromBucket countFromBucket,
48     Histogram<int64_t>::AvgFromBucket avgFromBucket) const;
49 template uint64_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>
50   ::computeTotalCount<Histogram<int64_t>::CountFromBucket>(
51     Histogram<int64_t>::CountFromBucket countFromBucket) const;
52
53 } // folly