MCPcopy Create free account
hub / github.com/apache/impala / ValidateSampler

Function ValidateSampler

be/src/util/runtime-profile-test.cc:1095–1109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1093}
1094
1095void ValidateSampler(const StreamingSampler<int, 10>& sampler, int expected_num,
1096 int expected_period, int expected_delta) {
1097 const int* samples = NULL;
1098 int num_samples;
1099 int period;
1100
1101 samples = sampler.GetSamples(&num_samples, &period);
1102 EXPECT_TRUE(samples != NULL);
1103 EXPECT_EQ(num_samples, expected_num);
1104 EXPECT_EQ(period, expected_period);
1105
1106 for (int i = 0; i < expected_num - 1; ++i) {
1107 EXPECT_EQ(samples[i] + expected_delta, samples[i + 1]) << i;
1108 }
1109}
1110
1111TEST(CountersTest, StreamingSampler) {
1112 StreamingSampler<int, 10> sampler(500);

Callers 1

TESTFunction · 0.85

Calls 1

GetSamplesMethod · 0.45

Tested by

no test coverage detected