Make changes for making opencensus API visible from gRPC namespace

pull/18396/head
Karthik Ravi Shankar 6 years ago
parent f66b654795
commit f570c5ce7e
  1. 15
      include/grpcpp/opencensus.h
  2. 3
      test/cpp/ext/filters/census/stats_plugin_end2end_test.cc

@ -21,4 +21,19 @@
#include "grpcpp/opencensus_impl.h"
namespace grpc {
static inline void RegisterOpenCensusPlugin() {
::grpc_impl::RegisterOpenCensusPlugin();
}
static inline void RegisterOpenCensusViewsForExport() {
::grpc_impl::RegisterOpenCensusViewsForExport();
}
static inline ::opencensus::trace::Span GetSpanFromServerContext(
ServerContext* context) {
return ::grpc_impl::GetSpanFromServerContext(context);
}
} // namespace grpc
#endif // GRPCPP_OPENCENSUS_H

@ -25,6 +25,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "include/grpc++/grpc++.h"
#include "include/grpcpp/opencensus.h"
#include "opencensus/stats/stats.h"
#include "opencensus/stats/testing/test_utils.h"
#include "src/cpp/ext/filters/census/grpc_plugin.h"
@ -58,7 +59,7 @@ class EchoServer final : public EchoTestService::Service {
class StatsPluginEnd2EndTest : public ::testing::Test {
protected:
static void SetUpTestCase() { grpc_impl::RegisterOpenCensusPlugin(); }
static void SetUpTestCase() { grpc::RegisterOpenCensusPlugin(); }
void SetUp() {
// Set up a synchronous server on a different thread to avoid the asynch

Loading…
Cancel
Save