20b4c2f12317330f6523c58fd41f07ff41f17548
[folly.git] / folly / stats / Instantiations.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/BucketedTimeSeries.h>
25 #include <folly/stats/BucketedTimeSeries-defs.h>
26
27 #include <folly/stats/Histogram.h>
28 #include <folly/stats/Histogram-defs.h>
29
30 #include <folly/stats/MultiLevelTimeSeries.h>
31 #include <folly/stats/MultiLevelTimeSeries-defs.h>
32
33 #include <folly/stats/TimeseriesHistogram.h>
34 #include <folly/stats/TimeseriesHistogram-defs.h>
35
36 namespace folly {
37
38 template class BucketedTimeSeries<int64_t>;
39 template class Histogram<int64_t>;
40 template class detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>;
41 template class MultiLevelTimeSeries<int64_t>;
42 template class TimeseriesHistogram<int64_t>;
43
44 // Histogram::getPercentileBucketIdx(), Histogram::getPercentileEstimate()
45 // and Histogram::computeTotalCount()
46 // are implemented using template methods.  Instantiate the default versions of
47 // these methods too, so anyone using them won't also need to explicitly
48 // include Histogram-defs.h
49 template size_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>::
50     getPercentileBucketIdx<Histogram<int64_t>::CountFromBucket>(
51         double pct,
52         Histogram<int64_t>::CountFromBucket countFromBucket,
53         double* lowPct,
54         double* highPct) const;
55 template int64_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>
56   ::getPercentileEstimate<Histogram<int64_t>::CountFromBucket,
57                           Histogram<int64_t>::AvgFromBucket>(
58     double pct,
59     Histogram<int64_t>::CountFromBucket countFromBucket,
60     Histogram<int64_t>::AvgFromBucket avgFromBucket) const;
61 template uint64_t detail::HistogramBuckets<int64_t, Histogram<int64_t>::Bucket>
62   ::computeTotalCount<Histogram<int64_t>::CountFromBucket>(
63     Histogram<int64_t>::CountFromBucket countFromBucket) const;
64
65 } // folly