proxygen
|
#include <folly/stats/BucketedTimeSeries-defs.h>
#include <folly/stats/BucketedTimeSeries.h>
#include <folly/stats/MultiLevelTimeSeries-defs.h>
#include <folly/stats/MultiLevelTimeSeries.h>
#include <folly/stats/detail/Bucket.h>
#include <array>
#include <glog/logging.h>
#include <folly/container/Foreach.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Namespaces | |
IntMHTS | |
Typedefs | |
using | Bucket = folly::detail::Bucket< int64_t > |
using | StatsClock = folly::LegacyStatsClock< std::chrono::seconds > |
using | TimePoint = StatsClock::time_point |
using | Duration = StatsClock::duration |
Enumerations | |
enum | IntMHTS::Levels { IntMHTS::MINUTE, IntMHTS::HOUR, IntMHTS::ALLTIME, IntMHTS::NUM_LEVELS } |
Functions | |
std::ostream & | std::operator<< (std::ostream &os, std::chrono::seconds s) |
std::ostream & | std::operator<< (std::ostream &os, TimePoint tp) |
TEST (BucketedTimeSeries, getBucketInfo) | |
void | testUpdate100x10 (size_t offset) |
TEST (BucketedTimeSeries, update100x10) | |
TEST (BucketedTimeSeries, update71x5) | |
TEST (BucketedTimeSeries, elapsed) | |
TEST (BucketedTimeSeries, rate) | |
TEST (BucketedTimeSeries, avgTypeConversion) | |
TEST (BucketedTimeSeries, forEachBucket) | |
TEST (BucketedTimeSeries, queryByIntervalSimple) | |
TEST (BucketedTimeSeries, queryByInterval) | |
TEST (BucketedTimeSeries, rateByInterval) | |
TEST (BucketedTimeSeries, addHistorical) | |
TEST (BucketedTimeSeries, reConstructEmptyTimeSeries) | |
TEST (BucketedTimeSeries, reConstructWithValidData) | |
TEST (BucketedTimeSeries, reConstructWithCorruptedData) | |
TEST (MinuteHourTimeSeries, Basic) | |
TEST (MinuteHourTimeSeries, QueryByInterval) | |
TEST (MultiLevelTimeSeries, Basic) | |
TEST (MultiLevelTimeSeries, QueryByInterval) | |
Variables | |
const seconds | IntMHTS::kMinuteHourDurations [] = {seconds(60), seconds(3600), seconds(0)} |
using Bucket = folly::detail::Bucket<int64_t> |
Definition at line 35 of file TimeSeriesTest.cpp.
using Duration = StatsClock::duration |
Definition at line 38 of file TimeSeriesTest.cpp.
using StatsClock = folly::LegacyStatsClock<std::chrono::seconds> |
Definition at line 36 of file TimeSeriesTest.cpp.
using TimePoint = StatsClock::time_point |
Definition at line 37 of file TimeSeriesTest.cpp.
std::ostream& std::operator<< | ( | std::ostream & | os, |
std::chrono::seconds | s | ||
) |
Definition at line 44 of file TimeSeriesTest.cpp.
std::ostream& std::operator<< | ( | std::ostream & | os, |
TimePoint | tp | ||
) |
Definition at line 48 of file TimeSeriesTest.cpp.
TEST | ( | BucketedTimeSeries | , |
getBucketInfo | |||
) |
Definition at line 85 of file TimeSeriesTest.cpp.
References data, EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::getBucketIdx(), folly::BucketedTimeSeries< VT, CT >::getBucketInfo(), and uint32_t.
TEST | ( | BucketedTimeSeries | , |
update100x10 | |||
) |
TEST | ( | BucketedTimeSeries | , |
update71x5 | |||
) |
Definition at line 211 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), folly::BucketedTimeSeries< VT, CT >::clear(), folly::BucketedTimeSeries< VT, CT >::count(), EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::sum(), and folly::BucketedTimeSeries< VT, CT >::update().
TEST | ( | BucketedTimeSeries | , |
elapsed | |||
) |
Definition at line 270 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::clear(), folly::BucketedTimeSeries< VT, CT >::elapsed(), EXPECT_EQ, start, and folly::BucketedTimeSeries< VT, CT >::update().
TEST | ( | BucketedTimeSeries | , |
rate | |||
) |
Definition at line 330 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), folly::BucketedTimeSeries< VT, CT >::count(), folly::BucketedTimeSeries< VT, CT >::countRate(), folly::BucketedTimeSeries< VT, CT >::elapsed(), EXPECT_EQ, EXPECT_NEAR, folly::BucketedTimeSeries< VT, CT >::rate(), folly::BucketedTimeSeries< VT, CT >::sum(), and folly::BucketedTimeSeries< VT, CT >::update().
TEST | ( | BucketedTimeSeries | , |
avgTypeConversion | |||
) |
Definition at line 363 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::addValueAggregated(), folly::BucketedTimeSeries< VT, CT >::avg(), EXPECT_DOUBLE_EQ, EXPECT_EQ, EXPECT_NEAR, FOR_EACH_RANGE, i, int16_t, int32_t, int64_t, int8_t, max, uint64_t, uint8_t, and value.
TEST | ( | BucketedTimeSeries | , |
forEachBucket | |||
) |
Definition at line 498 of file TimeSeriesTest.cpp.
References b, data, EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::forEachBucket(), folly::BucketedTimeSeries< VT, CT >::getBucketByIndex(), deadlock::info(), s, and start.
TEST | ( | BucketedTimeSeries | , |
queryByIntervalSimple | |||
) |
Definition at line 560 of file TimeSeriesTest.cpp.
References a, folly::BucketedTimeSeries< VT, CT >::addValue(), EXPECT_EQ, i, and folly::BucketedTimeSeries< VT, CT >::sum().
TEST | ( | BucketedTimeSeries | , |
queryByInterval | |||
) |
Definition at line 573 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), b, folly::BucketedTimeSeries< VT, CT >::count(), folly::BucketedTimeSeries< VT, CT >::elapsed(), folly::test::end(), EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::getEarliestTime(), folly::BucketedTimeSeries< VT, CT >::getLatestTime(), i, max, folly::BucketedTimeSeries< VT, CT >::rate(), start, folly::BucketedTimeSeries< VT, CT >::sum(), and uint64_t.
TEST | ( | BucketedTimeSeries | , |
rateByInterval | |||
) |
Definition at line 704 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), b, folly::BucketedTimeSeries< VT, CT >::countRate(), folly::test::end(), EXPECT_EQ, i, folly::BucketedTimeSeries< VT, CT >::rate(), and start.
TEST | ( | BucketedTimeSeries | , |
addHistorical | |||
) |
Definition at line 755 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), b, folly::BucketedTimeSeries< VT, CT >::count(), EXPECT_EQ, EXPECT_FALSE, i, and folly::BucketedTimeSeries< VT, CT >::rate().
TEST | ( | BucketedTimeSeries | , |
reConstructEmptyTimeSeries | |||
) |
Definition at line 801 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::buckets(), folly::BucketedTimeSeries< VT, CT >::duration(), EXPECT_EQ, EXPECT_TRUE, folly::BucketedTimeSeries< VT, CT >::firstTime(), folly::BucketedTimeSeries< VT, CT >::latestTime(), and verify().
TEST | ( | BucketedTimeSeries | , |
reConstructWithValidData | |||
) |
Definition at line 824 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), folly::BucketedTimeSeries< VT, CT >::buckets(), folly::BucketedTimeSeries< VT, CT >::clear(), folly::BucketedTimeSeries< VT, CT >::count(), folly::BucketedTimeSeries< VT, CT >::duration(), EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::firstTime(), folly::BucketedTimeSeries< VT, CT >::latestTime(), and folly::BucketedTimeSeries< VT, CT >::sum().
TEST | ( | BucketedTimeSeries | , |
reConstructWithCorruptedData | |||
) |
Definition at line 869 of file TimeSeriesTest.cpp.
References EXPECT_THROW.
TEST | ( | MinuteHourTimeSeries | , |
Basic | |||
) |
Definition at line 903 of file TimeSeriesTest.cpp.
References folly::MultiLevelTimeSeries< VT, CT >::addValue(), IntMHTS::ALLTIME, folly::MultiLevelTimeSeries< VT, CT >::avg(), folly::MultiLevelTimeSeries< VT, CT >::clear(), folly::BucketedTimeSeries< VT, CT >::elapsed(), EXPECT_EQ, folly::MultiLevelTimeSeries< VT, CT >::flush(), folly::MultiLevelTimeSeries< VT, CT >::getLevel(), IntMHTS::HOUR, i, IntMHTS::kMinuteHourDurations, IntMHTS::MINUTE, IntMHTS::NUM_LEVELS, folly::MultiLevelTimeSeries< VT, CT >::numLevels(), folly::MultiLevelTimeSeries< VT, CT >::rate(), and folly::MultiLevelTimeSeries< VT, CT >::sum().
TEST | ( | MinuteHourTimeSeries | , |
QueryByInterval | |||
) |
Definition at line 1020 of file TimeSeriesTest.cpp.
References a, folly::MultiLevelTimeSeries< VT, CT >::addValue(), folly::MultiLevelTimeSeries< VT, CT >::avg(), c, count, folly::MultiLevelTimeSeries< VT, CT >::count(), folly::test::end(), EXPECT_EQ, folly::MultiLevelTimeSeries< VT, CT >::flush(), i, IntMHTS::kMinuteHourDurations, IntMHTS::NUM_LEVELS, folly::MultiLevelTimeSeries< VT, CT >::rate(), s, start, and folly::MultiLevelTimeSeries< VT, CT >::sum().
TEST | ( | MultiLevelTimeSeries | , |
Basic | |||
) |
Definition at line 1107 of file TimeSeriesTest.cpp.
TEST | ( | MultiLevelTimeSeries | , |
QueryByInterval | |||
) |
Definition at line 1223 of file TimeSeriesTest.cpp.
References a, folly::MultiLevelTimeSeries< VT, CT >::addValue(), c, count, folly::test::end(), EXPECT_EQ, i, s, and start.
void testUpdate100x10 | ( | size_t | offset | ) |
Definition at line 139 of file TimeSeriesTest.cpp.
References folly::BucketedTimeSeries< VT, CT >::addValue(), folly::BucketedTimeSeries< VT, CT >::avg(), folly::BucketedTimeSeries< VT, CT >::clear(), folly::BucketedTimeSeries< VT, CT >::count(), EXPECT_EQ, folly::BucketedTimeSeries< VT, CT >::sum(), and folly::BucketedTimeSeries< VT, CT >::update().
Referenced by TEST().