Go to the documentation of this file.
24 #include <gtest/gtest.h>
51 TEST(StatsTest, IncCounters) {
53 std::unique_ptr<Snapshot> snapshot(
new Snapshot);
62 TEST(StatsTest, IncSpecificCounter) {
63 std::unique_ptr<Snapshot> snapshot(
new Snapshot);
88 const int kHistogram = GetParam();
89 std::vector<std::thread>
threads;
92 int expected_bucket) {
96 std::unique_ptr<Snapshot> snapshot(
new Snapshot);
101 auto delta = snapshot->delta();
107 <<
"\nhistogram:" << kHistogram
108 <<
"\nexpected_bucket:" << expected_bucket <<
"\nj:" << j;
113 int max_bucket_boundary =
117 for (
int j = -1000; j < max_bucket_boundary + 1000;) {
119 if (cur_bucket != expected_bucket) {
122 cur_bucket = expected_bucket;
126 if (j < max_bucket_boundary &&
147 int main(
int argc,
char** argv) {
151 #if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG)
#define GRPC_STATS_INC_COUNTER(ctr)
const int grpc_stats_histo_buckets[13]
@ GRPC_STATS_HISTOGRAM_COUNT
static uv_thread_t * threads
int main(int argc, char **argv)
@ GRPC_STATS_COUNTER_SYSCALL_POLL
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
#define GRPC_STATS_INC_SYSCALL_POLL()
INSTANTIATE_TEST_SUITE_P(HistogramTestCases, HistogramTest, ::testing::Range< int >(0, GRPC_STATS_HISTOGRAM_COUNT))
static int FindExpectedBucket(int i, int j)
const int grpc_stats_histo_start[13]
void grpc_stats_collect(grpc_stats_data *output)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
static void test_values(void)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
grpc_core::ExecCtx exec_ctx
UniquePtr< SSL_SESSION > ret
EXPECT_EQ(options.token_exchange_service_uri, "https://foo/exchange")
void(*const grpc_stats_inc_histogram[13])(int x)
void grpc_stats_diff(const grpc_stats_data *b, const grpc_stats_data *a, grpc_stats_data *c)
TEST(StatsTest, IncCounters)
@ GRPC_STATS_COUNTER_COUNT
TEST_P(HistogramTest, IncHistogram)
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
const int *const grpc_stats_histo_bucket_boundaries[13]
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:22