Histogram.cpp 2.1 KB

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