Example #1
0
/* Ensure all possible state transitions are called without causing problem */
static void test_init_shutdown(void) {
  census_stats_store_init();
  census_stats_store_init();
  census_stats_store_shutdown();
  census_stats_store_shutdown();
  census_stats_store_init();
}
Example #2
0
/* Test that record stats is noop when trace store is uninitialized. */
static void test_record_stats_with_trace_store_uninitialized(void) {
  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
  census_op_id id = {0, 0};
  census_aggregated_rpc_stats agg_stats = {0, NULL};

  census_init();
  id = census_tracing_start_op();
  census_add_method_tag(id, "m");
  census_tracing_end_op(id);
  /* shuts down trace store only. */
  census_tracing_shutdown();
  census_record_rpc_client_stats(id, &stats);
  census_get_client_stats(&agg_stats);
  GPR_ASSERT(agg_stats.num_entries == 0);
  census_stats_store_shutdown();
}
Example #3
0
void census_shutdown(void) {
  census_stats_store_shutdown();
  census_tracing_shutdown();
}