pull/18396/head
Karthik Ravi Shankar 6 years ago
parent 9a41671cb1
commit 4260fe1147
  1. 7
      src/cpp/ext/filters/census/grpc_plugin.h
  2. 7
      test/cpp/microbenchmarks/bm_opencensus_plugin.cc

@ -22,14 +22,11 @@
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include "include/grpcpp/opencensus_impl.h"
#include "include/grpcpp/opencensus.h"
#include "opencensus/stats/stats.h"
namespace grpc_impl {
class ServerContext;
}
namespace grpc {
class ServerContext;
// The tag keys set when recording RPC stats.
::opencensus::stats::TagKey ClientMethodTagKey();

@ -29,9 +29,12 @@
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/microbenchmarks/helpers.h"
using ::grpc::RegisterOpenCensusPlugin;
using ::grpc::RegisterOpenCensusViewsForExport;
absl::once_flag once;
void RegisterOnce() {
absl::call_once(once, grpc::RegisterOpenCensusPlugin);
absl::call_once(once, RegisterOpenCensusPlugin);
}
class EchoServer final : public grpc::testing::EchoTestService::Service {
@ -102,7 +105,7 @@ static void BM_E2eLatencyCensusEnabled(benchmark::State& state) {
RegisterOnce();
// This we can safely repeat, and doing so clears accumulated data to avoid
// initialization costs varying between runs.
grpc::RegisterOpenCensusViewsForExport();
RegisterOpenCensusViewsForExport();
EchoServerThread server;
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub =

Loading…
Cancel
Save