Lines Matching full:stats

11 #include "api/stats/rtc_stats.h"
20 #include "stats/test/rtc_test_stats.h"
52 WEBRTC_RTCSTATS_IMPL(RTCChildStats, RTCStats, "child-stats", &child_int)
66 "grandchild-stats",
70 RTCTestStats stats("testId", 42); in TEST() local
71 EXPECT_EQ(stats.id(), "testId"); in TEST()
72 EXPECT_EQ(stats.timestamp_us(), static_cast<int64_t>(42)); in TEST()
73 std::vector<const RTCStatsMemberInterface*> members = stats.Members(); in TEST()
78 stats.m_bool = true; in TEST()
79 stats.m_int32 = 123; in TEST()
80 stats.m_uint32 = 123; in TEST()
81 stats.m_int64 = 123; in TEST()
82 stats.m_uint64 = 123; in TEST()
83 stats.m_double = 123.0; in TEST()
84 stats.m_string = std::string("123"); in TEST()
101 stats.m_sequence_bool = sequence_bool; in TEST()
102 stats.m_sequence_int32 = sequence_int32; in TEST()
103 stats.m_sequence_uint32 = sequence_uint32; in TEST()
104 EXPECT_FALSE(stats.m_sequence_int64.is_defined()); in TEST()
105 stats.m_sequence_int64 = sequence_int64; in TEST()
106 stats.m_sequence_uint64 = sequence_uint64; in TEST()
107 stats.m_sequence_double = sequence_double; in TEST()
108 stats.m_sequence_string = sequence_string; in TEST()
112 EXPECT_EQ(*stats.m_bool, true); in TEST()
113 EXPECT_EQ(*stats.m_int32, static_cast<int32_t>(123)); in TEST()
114 EXPECT_EQ(*stats.m_uint32, static_cast<uint32_t>(123)); in TEST()
115 EXPECT_EQ(*stats.m_int64, static_cast<int64_t>(123)); in TEST()
116 EXPECT_EQ(*stats.m_uint64, static_cast<uint64_t>(123)); in TEST()
117 EXPECT_EQ(*stats.m_double, 123.0); in TEST()
118 EXPECT_EQ(*stats.m_string, std::string("123")); in TEST()
119 EXPECT_EQ(*stats.m_sequence_bool, sequence_bool); in TEST()
120 EXPECT_EQ(*stats.m_sequence_int32, sequence_int32); in TEST()
121 EXPECT_EQ(*stats.m_sequence_uint32, sequence_uint32); in TEST()
122 EXPECT_EQ(*stats.m_sequence_int64, sequence_int64); in TEST()
123 EXPECT_EQ(*stats.m_sequence_uint64, sequence_uint64); in TEST()
124 EXPECT_EQ(*stats.m_sequence_double, sequence_double); in TEST()
125 EXPECT_EQ(*stats.m_sequence_string, sequence_string); in TEST()
129 stats.m_sequence_int32->clear(); in TEST()
130 stats.m_sequence_int32->insert(stats.m_sequence_int32->end(), in TEST()
133 EXPECT_EQ(*stats.m_sequence_int32, numbers_sequence); in TEST()
204 RTCGrandChildStats stats("grandchild", 0.0); in TEST() local
205 stats.child_int = 1; in TEST()
206 stats.grandchild_int = 2; in TEST()
208 for (const RTCStatsMemberInterface* member : stats.Members()) { in TEST()
213 std::unique_ptr<RTCStats> copy_ptr = stats.copy(); in TEST()
215 EXPECT_EQ(*copy.child_int, *stats.child_int); in TEST()
216 EXPECT_EQ(*copy.grandchild_int, *stats.grandchild_int); in TEST()
241 RTCTestStats stats(id, timestamp); in TEST() local
242 stats.m_bool = m_bool; in TEST()
243 stats.m_int32 = m_int32; in TEST()
244 stats.m_int64 = m_int64; in TEST()
245 stats.m_double = m_double; in TEST()
246 stats.m_string = m_string; in TEST()
247 stats.m_sequence_bool = sequence_bool; in TEST()
248 stats.m_sequence_int32 = sequence_int32; in TEST()
249 stats.m_sequence_int64 = sequence_int64; in TEST()
250 stats.m_sequence_double = sequence_double; in TEST()
251 stats.m_sequence_string = sequence_string; in TEST()
254 EXPECT_TRUE(Json::Reader().parse(stats.ToJson(), json_output)); in TEST()
281 EXPECT_EQ(id, stats.id()); in TEST()
282 EXPECT_EQ(timestamp, stats.timestamp_us()); in TEST()
283 EXPECT_EQ(m_bool, *stats.m_bool); in TEST()
284 EXPECT_EQ(m_int32, *stats.m_int32); in TEST()
285 EXPECT_EQ(m_string, *stats.m_string); in TEST()
286 EXPECT_EQ(sequence_bool, *stats.m_sequence_bool); in TEST()
287 EXPECT_EQ(sequence_int32, *stats.m_sequence_int32); in TEST()
288 EXPECT_EQ(sequence_string, *stats.m_sequence_string); in TEST()
290 EXPECT_NEAR(m_double, *stats.m_double, GetExpectedError(*stats.m_double)); in TEST()
292 EXPECT_EQ(sequence_double.size(), stats.m_sequence_double->size()); in TEST()
293 for (size_t i = 0; i < stats.m_sequence_double->size(); ++i) { in TEST()
294 EXPECT_NEAR(sequence_double[i], stats.m_sequence_double->at(i), in TEST()
295 GetExpectedError(stats.m_sequence_double->at(i))); in TEST()
311 double stats_m_int64_as_double = static_cast<double>(*stats.m_int64); in TEST()
315 EXPECT_EQ(sequence_int64_as_double.size(), stats.m_sequence_int64->size()); in TEST()
316 for (size_t i = 0; i < stats.m_sequence_int64->size(); ++i) { in TEST()
318 static_cast<double>((*stats.m_sequence_int64)[i]); in TEST()
323 // Neither stats.m_uint32 nor stats.m_uint64 are defined, so "mUint64" and in TEST()
327 EXPECT_FALSE(stats.m_uint32.is_defined()); in TEST()
328 EXPECT_FALSE(stats.m_uint64.is_defined()); in TEST()
332 std::cout << stats.ToJson() << std::endl; in TEST()
358 RTCTestStats stats("testId", 0.0); in TEST() local
359 EXPECT_FALSE(stats.m_int32.is_defined()); in TEST()
360 EXPECT_DEATH(*stats.m_int32, ""); in TEST()
364 RTCGrandChildStats stats("grandchild", 0.0); in TEST() local
365 EXPECT_DEATH(stats.cast_to<RTCChildStats>(), ""); in TEST()