diff options
Diffstat (limited to 'test/core/fling/client.cc')
-rw-r--r-- | test/core/fling/client.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/core/fling/client.cc b/test/core/fling/client.cc index 28e62e0e83..05dc3052d1 100644 --- a/test/core/fling/client.cc +++ b/test/core/fling/client.cc @@ -21,11 +21,12 @@ #include <stdio.h> #include <string.h> -#include <grpc/support/cmdline.h> #include <grpc/support/log.h> #include <grpc/support/time.h> -#include <grpc/support/useful.h> + +#include "src/core/lib/gpr/useful.h" #include "src/core/lib/profiling/timers.h" +#include "test/core/util/cmdline.h" #include "test/core/util/grpc_profiler.h" #include "test/core/util/histogram.h" #include "test/core/util/test_config.h" @@ -74,7 +75,7 @@ static void init_ping_pong_request(void) { } static void step_ping_pong_request(void) { - GPR_TIMER_BEGIN("ping_pong", 1); + GPR_TIMER_SCOPE("ping_pong", 1); grpc_slice host = grpc_slice_from_static_string("localhost"); call = grpc_channel_create_call( channel, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, @@ -87,7 +88,6 @@ static void step_ping_pong_request(void) { grpc_call_unref(call); grpc_byte_buffer_destroy(response_payload_recv); call = nullptr; - GPR_TIMER_END("ping_pong", 1); } static void init_ping_pong_stream(void) { @@ -117,18 +117,17 @@ static void init_ping_pong_stream(void) { } static void step_ping_pong_stream(void) { + GPR_TIMER_SCOPE("ping_pong", 1); grpc_call_error error; - GPR_TIMER_BEGIN("ping_pong", 1); error = grpc_call_start_batch(call, stream_step_ops, 2, (void*)1, nullptr); GPR_ASSERT(GRPC_CALL_OK == error); grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); grpc_byte_buffer_destroy(response_payload_recv); - GPR_TIMER_END("ping_pong", 1); } static double now(void) { gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME); - return 1e9 * (double)tv.tv_sec + tv.tv_nsec; + return 1e9 * static_cast<double>(tv.tv_sec) + tv.tv_nsec; } typedef struct { @@ -196,7 +195,8 @@ int main(int argc, char** argv) { channel = grpc_insecure_channel_create(target, nullptr, nullptr); cq = grpc_completion_queue_create_for_next(nullptr); - the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); + the_buffer = + grpc_raw_byte_buffer_create(&slice, static_cast<size_t>(payload_size)); histogram = grpc_histogram_create(0.01, 60e9); sc.init(); |