stats_plugin_end2end_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #include <string>
20 #include <thread> // NOLINT
21 #include <vector>
22 
23 #include "absl/strings/str_cat.h"
24 #include "absl/strings/string_view.h"
25 #include "gmock/gmock.h"
26 #include "gtest/gtest.h"
27 #include "opencensus/stats/stats.h"
28 #include "opencensus/stats/tag_key.h"
29 #include "opencensus/stats/testing/test_utils.h"
30 #include "opencensus/tags/tag_map.h"
31 #include "opencensus/tags/with_tag_map.h"
32 
33 #include <grpc++/grpc++.h>
34 #include <grpcpp/opencensus.h>
35 
38 #include "src/proto/grpc/testing/echo.grpc.pb.h"
41 
42 namespace grpc {
43 namespace testing {
44 namespace {
45 
46 using ::opencensus::stats::Aggregation;
47 using ::opencensus::stats::Distribution;
49 using ::opencensus::stats::ViewDescriptor;
50 using ::opencensus::stats::testing::TestUtils;
51 using ::opencensus::tags::TagKey;
52 using ::opencensus::tags::WithTagMap;
53 
54 const auto TEST_TAG_KEY = TagKey::Register("my_key");
55 const auto TEST_TAG_VALUE = "my_value";
56 const char* kExpectedTraceIdKey = "expected_trace_id";
57 
58 class EchoServer final : public TestServiceImpl {
59  Status Echo(ServerContext* context, const EchoRequest* request,
60  EchoResponse* response) override {
63  }
64 
65  Status BidiStream(
66  ServerContext* context,
67  ServerReaderWriter<EchoResponse, EchoRequest>* stream) override {
70  }
71 
72  private:
73  void CheckMetadata(ServerContext* context) {
74  for (const auto& metadata : context->client_metadata()) {
75  if (metadata.first == kExpectedTraceIdKey) {
76  EXPECT_EQ(metadata.second, reinterpret_cast<const CensusContext*>(
78  ->Span()
79  .context()
80  .trace_id()
81  .ToHex());
82  break;
83  }
84  }
85  }
86 };
87 
88 class StatsPluginEnd2EndTest : public ::testing::Test {
89  protected:
90  static void SetUpTestCase() { RegisterOpenCensusPlugin(); }
91 
92  void SetUp() override {
93  // Set up a synchronous server on a different thread to avoid the asynch
94  // interface.
96  int port;
97  // Use IPv4 here because it's less flaky than IPv6 ("[::]:0") on Travis.
98  builder.AddListeningPort("0.0.0.0:0", grpc::InsecureServerCredentials(),
99  &port);
100  builder.RegisterService(&service_);
101  server_ = builder.BuildAndStart();
102  ASSERT_NE(nullptr, server_);
103  ASSERT_NE(0, port);
104  server_address_ = absl::StrCat("localhost:", port);
105  server_thread_ = std::thread(&StatsPluginEnd2EndTest::RunServerLoop, this);
106 
107  stub_ = EchoTestService::NewStub(grpc::CreateChannel(
109  }
110 
111  void ResetStub(std::shared_ptr<Channel> channel) {
112  stub_ = EchoTestService::NewStub(channel);
113  }
114 
115  void TearDown() override {
116  server_->Shutdown();
117  server_thread_.join();
118  }
119 
120  void RunServerLoop() { server_->Wait(); }
121 
122  const std::string client_method_name_ = "grpc.testing.EchoTestService/Echo";
123  const std::string server_method_name_ = "grpc.testing.EchoTestService/Echo";
124 
127  std::unique_ptr<grpc::Server> server_;
129 
130  std::unique_ptr<EchoTestService::Stub> stub_;
131 };
132 
133 TEST_F(StatsPluginEnd2EndTest, ErrorCount) {
134  const auto client_method_descriptor =
135  ViewDescriptor()
137  .set_name("client_method")
138  .set_aggregation(Aggregation::Count())
139  .add_column(ClientMethodTagKey())
140  .add_column(TEST_TAG_KEY);
141  View client_method_view(client_method_descriptor);
142  const auto server_method_descriptor =
143  ViewDescriptor()
145  .set_name("server_method")
146  .set_aggregation(Aggregation::Count())
147  .add_column(ServerMethodTagKey());
148  //.add_column(TEST_TAG_KEY);
149  View server_method_view(server_method_descriptor);
150 
151  const auto client_status_descriptor =
152  ViewDescriptor()
154  .set_name("client_status")
155  .set_aggregation(Aggregation::Count())
156  .add_column(ClientStatusTagKey())
157  .add_column(TEST_TAG_KEY);
158  View client_status_view(client_status_descriptor);
159  const auto server_status_descriptor =
160  ViewDescriptor()
162  .set_name("server_status")
163  .set_aggregation(Aggregation::Count())
164  .add_column(ServerStatusTagKey());
165  View server_status_view(server_status_descriptor);
166 
167  // Cover all valid statuses.
168  for (int i = 0; i <= 16; ++i) {
169  EchoRequest request;
170  request.set_message("foo");
171  request.mutable_param()->mutable_expected_error()->set_code(i);
172  EchoResponse response;
174  {
175  WithTagMap tags({{TEST_TAG_KEY, TEST_TAG_VALUE}});
177  }
178  }
180  TestUtils::Flush();
181 
182  // Client side views can be tagged with custom tags.
183  EXPECT_THAT(
184  client_method_view.GetData().int_data(),
186  ::testing::ElementsAre(client_method_name_, TEST_TAG_VALUE), 17)));
187  // TODO(unknown): Implement server view tagging with custom tags.
188  EXPECT_THAT(server_method_view.GetData().int_data(),
191 
192  // Client side views can be tagged with custom tags.
193  auto client_tags = {
194  ::testing::Pair(::testing::ElementsAre("OK", TEST_TAG_VALUE), 1),
195  ::testing::Pair(::testing::ElementsAre("CANCELLED", TEST_TAG_VALUE), 1),
196  ::testing::Pair(::testing::ElementsAre("UNKNOWN", TEST_TAG_VALUE), 1),
198  ::testing::ElementsAre("INVALID_ARGUMENT", TEST_TAG_VALUE), 1),
200  ::testing::ElementsAre("DEADLINE_EXCEEDED", TEST_TAG_VALUE), 1),
201  ::testing::Pair(::testing::ElementsAre("NOT_FOUND", TEST_TAG_VALUE), 1),
202  ::testing::Pair(::testing::ElementsAre("ALREADY_EXISTS", TEST_TAG_VALUE),
203  1),
205  ::testing::ElementsAre("PERMISSION_DENIED", TEST_TAG_VALUE), 1),
206  ::testing::Pair(::testing::ElementsAre("UNAUTHENTICATED", TEST_TAG_VALUE),
207  1),
209  ::testing::ElementsAre("RESOURCE_EXHAUSTED", TEST_TAG_VALUE), 1),
211  ::testing::ElementsAre("FAILED_PRECONDITION", TEST_TAG_VALUE), 1),
212  ::testing::Pair(::testing::ElementsAre("ABORTED", TEST_TAG_VALUE), 1),
213  ::testing::Pair(::testing::ElementsAre("OUT_OF_RANGE", TEST_TAG_VALUE),
214  1),
215  ::testing::Pair(::testing::ElementsAre("UNIMPLEMENTED", TEST_TAG_VALUE),
216  1),
217  ::testing::Pair(::testing::ElementsAre("INTERNAL", TEST_TAG_VALUE), 1),
218  ::testing::Pair(::testing::ElementsAre("UNAVAILABLE", TEST_TAG_VALUE), 1),
219  ::testing::Pair(::testing::ElementsAre("DATA_LOSS", TEST_TAG_VALUE), 1),
220  };
221 
222  // TODO(unknown): Implement server view tagging with custom tags.
223  auto server_tags = {
225  ::testing::Pair(::testing::ElementsAre("CANCELLED"), 1),
226  ::testing::Pair(::testing::ElementsAre("UNKNOWN"), 1),
227  ::testing::Pair(::testing::ElementsAre("INVALID_ARGUMENT"), 1),
228  ::testing::Pair(::testing::ElementsAre("DEADLINE_EXCEEDED"), 1),
229  ::testing::Pair(::testing::ElementsAre("NOT_FOUND"), 1),
230  ::testing::Pair(::testing::ElementsAre("ALREADY_EXISTS"), 1),
231  ::testing::Pair(::testing::ElementsAre("PERMISSION_DENIED"), 1),
232  ::testing::Pair(::testing::ElementsAre("UNAUTHENTICATED"), 1),
233  ::testing::Pair(::testing::ElementsAre("RESOURCE_EXHAUSTED"), 1),
234  ::testing::Pair(::testing::ElementsAre("FAILED_PRECONDITION"), 1),
235  ::testing::Pair(::testing::ElementsAre("ABORTED"), 1),
236  ::testing::Pair(::testing::ElementsAre("OUT_OF_RANGE"), 1),
237  ::testing::Pair(::testing::ElementsAre("UNIMPLEMENTED"), 1),
238  ::testing::Pair(::testing::ElementsAre("INTERNAL"), 1),
239  ::testing::Pair(::testing::ElementsAre("UNAVAILABLE"), 1),
240  ::testing::Pair(::testing::ElementsAre("DATA_LOSS"), 1),
241  };
242 
243  EXPECT_THAT(client_status_view.GetData().int_data(),
244  ::testing::UnorderedElementsAreArray(client_tags));
245  EXPECT_THAT(server_status_view.GetData().int_data(),
246  ::testing::UnorderedElementsAreArray(server_tags));
247 }
248 
249 TEST_F(StatsPluginEnd2EndTest, RequestReceivedBytesPerRpc) {
250  View client_sent_bytes_per_rpc_view(ClientSentBytesPerRpcCumulative());
251  View client_received_bytes_per_rpc_view(
253  View server_sent_bytes_per_rpc_view(ServerSentBytesPerRpcCumulative());
254  View server_received_bytes_per_rpc_view(
256 
257  {
258  EchoRequest request;
259  request.set_message("foo");
260  EchoResponse response;
263  ASSERT_TRUE(status.ok());
264  EXPECT_EQ("foo", response.message());
265  }
267  TestUtils::Flush();
268 
269  EXPECT_THAT(client_received_bytes_per_rpc_view.GetData().distribution_data(),
273  ::testing::Property(&Distribution::mean,
274  ::testing::Gt(0.0))))));
275  EXPECT_THAT(client_sent_bytes_per_rpc_view.GetData().distribution_data(),
279  ::testing::Property(&Distribution::mean,
280  ::testing::Gt(0.0))))));
281  EXPECT_THAT(server_received_bytes_per_rpc_view.GetData().distribution_data(),
285  ::testing::Property(&Distribution::mean,
286  ::testing::Gt(0.0))))));
287  EXPECT_THAT(server_sent_bytes_per_rpc_view.GetData().distribution_data(),
291  ::testing::Property(&Distribution::mean,
292  ::testing::Gt(0.0))))));
293 }
294 
295 TEST_F(StatsPluginEnd2EndTest, Latency) {
296  View client_latency_view(ClientRoundtripLatencyCumulative());
297  View client_server_latency_view(ClientServerLatencyCumulative());
298  View server_server_latency_view(ServerServerLatencyCumulative());
299 
300  const absl::Time start_time = absl::Now();
301  {
302  EchoRequest request;
303  request.set_message("foo");
304  EchoResponse response;
307  ASSERT_TRUE(status.ok());
308  EXPECT_EQ("foo", response.message());
309  }
310  // We do not know exact latency/elapsed time, but we know it is less than the
311  // entire time spent making the RPC.
312  const double max_time = absl::ToDoubleMilliseconds(absl::Now() - start_time);
313 
315  TestUtils::Flush();
316 
317  EXPECT_THAT(
318  client_latency_view.GetData().distribution_data(),
321  ::testing::AllOf(
323  ::testing::Property(&Distribution::mean, ::testing::Gt(0.0)),
324  ::testing::Property(&Distribution::mean,
325  ::testing::Lt(max_time))))));
326 
327  // Elapsed time is a subinterval of total latency.
328  const auto client_latency = client_latency_view.GetData()
329  .distribution_data()
330  .find({client_method_name_})
331  ->second.mean();
332  EXPECT_THAT(
333  client_server_latency_view.GetData().distribution_data(),
336  ::testing::AllOf(
338  ::testing::Property(&Distribution::mean, ::testing::Gt(0.0)),
339  ::testing::Property(&Distribution::mean,
340  ::testing::Lt(client_latency))))));
341 
342  // client server elapsed time should be the same value propagated to the
343  // client.
344  const auto client_elapsed_time = client_server_latency_view.GetData()
345  .distribution_data()
346  .find({client_method_name_})
347  ->second.mean();
348  EXPECT_THAT(
349  server_server_latency_view.GetData().distribution_data(),
352  ::testing::AllOf(
354  ::testing::Property(&Distribution::mean,
355  ::testing::DoubleEq(client_elapsed_time))))));
356 }
357 
358 TEST_F(StatsPluginEnd2EndTest, CompletedRpcs) {
359  View client_completed_rpcs_view(ClientCompletedRpcsCumulative());
360  View server_completed_rpcs_view(ServerCompletedRpcsCumulative());
361 
362  EchoRequest request;
363  request.set_message("foo");
364  EchoResponse response;
365  const int count = 5;
366  for (int i = 0; i < count; ++i) {
367  {
370  ASSERT_TRUE(status.ok());
371  EXPECT_EQ("foo", response.message());
372  }
374  TestUtils::Flush();
375 
376  EXPECT_THAT(client_completed_rpcs_view.GetData().int_data(),
378  ::testing::ElementsAre(client_method_name_, "OK"), i + 1)));
379  EXPECT_THAT(server_completed_rpcs_view.GetData().int_data(),
381  ::testing::ElementsAre(server_method_name_, "OK"), i + 1)));
382  }
383 
384  // Client should see calls that are cancelled without calling Finish().
385  {
386  ClientContext ctx;
387  auto stream = stub_->BidiStream(&ctx);
388  ctx.TryCancel();
389  }
391  TestUtils::Flush();
392  EXPECT_THAT(client_completed_rpcs_view.GetData().int_data(),
395  "grpc.testing.EchoTestService/BidiStream", "CANCELLED"),
396  1)));
397 }
398 
399 TEST_F(StatsPluginEnd2EndTest, RequestReceivedMessagesPerRpc) {
400  // TODO(unknown): Use streaming RPCs.
401  View client_received_messages_per_rpc_view(
403  View client_sent_messages_per_rpc_view(
405  View server_received_messages_per_rpc_view(
407  View server_sent_messages_per_rpc_view(
409 
410  EchoRequest request;
411  request.set_message("foo");
412  EchoResponse response;
413  const int count = 5;
414  for (int i = 0; i < count; ++i) {
415  {
418  ASSERT_TRUE(status.ok());
419  EXPECT_EQ("foo", response.message());
420  }
422  TestUtils::Flush();
423 
424  EXPECT_THAT(
425  client_received_messages_per_rpc_view.GetData().distribution_data(),
429  ::testing::Property(&Distribution::mean,
430  ::testing::DoubleEq(1.0))))));
431  EXPECT_THAT(
432  client_sent_messages_per_rpc_view.GetData().distribution_data(),
436  ::testing::Property(&Distribution::mean,
437  ::testing::DoubleEq(1.0))))));
438  EXPECT_THAT(
439  server_received_messages_per_rpc_view.GetData().distribution_data(),
443  ::testing::Property(&Distribution::mean,
444  ::testing::DoubleEq(1.0))))));
445  EXPECT_THAT(
446  server_sent_messages_per_rpc_view.GetData().distribution_data(),
450  ::testing::Property(&Distribution::mean,
451  ::testing::DoubleEq(1.0))))));
452  }
453 }
454 
455 TEST_F(StatsPluginEnd2EndTest, TestRetryStatsWithoutAdditionalRetries) {
456  View client_retries_cumulative_view(ClientRetriesCumulative());
457  View client_transparent_retries_cumulative_view(
459  View client_retry_delay_per_call_view(ClientRetryDelayPerCallCumulative());
460  EchoRequest request;
461  request.set_message("foo");
462  EchoResponse response;
463  const int count = 5;
464  for (int i = 0; i < count; ++i) {
465  {
468  ASSERT_TRUE(status.ok());
469  EXPECT_EQ("foo", response.message());
470  }
472  TestUtils::Flush();
473  EXPECT_THAT(
474  client_retries_cumulative_view.GetData().int_data(),
477  EXPECT_THAT(
478  client_transparent_retries_cumulative_view.GetData().int_data(),
481  EXPECT_THAT(
482  client_retry_delay_per_call_view.GetData().distribution_data(),
485  ::testing::Property(&Distribution::mean, ::testing::Eq(0)))));
486  }
487 }
488 
489 TEST_F(StatsPluginEnd2EndTest, TestRetryStatsWithAdditionalRetries) {
490  View client_retries_cumulative_view(ClientRetriesCumulative());
491  View client_transparent_retries_cumulative_view(
493  View client_retry_delay_per_call_view(ClientRetryDelayPerCallCumulative());
494  ChannelArguments args;
495  args.SetString(GRPC_ARG_SERVICE_CONFIG,
496  "{\n"
497  " \"methodConfig\": [ {\n"
498  " \"name\": [\n"
499  " { \"service\": \"grpc.testing.EchoTestService\" }\n"
500  " ],\n"
501  " \"retryPolicy\": {\n"
502  " \"maxAttempts\": 3,\n"
503  " \"initialBackoff\": \"0.1s\",\n"
504  " \"maxBackoff\": \"120s\",\n"
505  " \"backoffMultiplier\": 1,\n"
506  " \"retryableStatusCodes\": [ \"ABORTED\" ]\n"
507  " }\n"
508  " } ]\n"
509  "}");
510  auto channel =
512  ResetStub(channel);
513  EchoRequest request;
514  request.mutable_param()->mutable_expected_error()->set_code(
516  request.set_message("foo");
517  EchoResponse response;
518  const int count = 5;
519  for (int i = 0; i < count; ++i) {
520  {
523  EXPECT_EQ(status.error_code(), StatusCode::ABORTED);
524  }
526  TestUtils::Flush();
527  EXPECT_THAT(client_retries_cumulative_view.GetData().int_data(),
530  ::testing::Eq((i + 1) * 2))));
531  EXPECT_THAT(
532  client_transparent_retries_cumulative_view.GetData().int_data(),
535  auto data = client_retry_delay_per_call_view.GetData().distribution_data();
536  for (const auto& entry : data) {
537  gpr_log(GPR_ERROR, "Mean Retry Delay %s: %lf ms", entry.first[0].c_str(),
538  entry.second.mean());
539  }
540  // We expect the retry delay to be around 100ms.
541  EXPECT_THAT(
542  client_retry_delay_per_call_view.GetData().distribution_data(),
546  &Distribution::mean,
547  ::testing::AllOf(::testing::Ge(50), ::testing::Le(300))))));
548  }
549 }
550 
551 // Test that CensusContext object set by application is used.
552 TEST_F(StatsPluginEnd2EndTest, TestApplicationCensusContextFlows) {
554  ResetStub(channel);
555  EchoRequest request;
556  request.set_message("foo");
557  EchoResponse response;
559  grpc::CensusContext app_census_context("root", ::opencensus::tags::TagMap{});
561  reinterpret_cast<census_context*>(&app_census_context));
562  context.AddMetadata(kExpectedTraceIdKey,
563  app_census_context.Span().context().trace_id().ToHex());
565  EXPECT_TRUE(status.ok());
566 }
567 
568 } // namespace
569 } // namespace testing
570 } // namespace grpc
571 
572 int main(int argc, char** argv) {
573  grpc::testing::TestEnvironment env(&argc, argv);
574  ::testing::InitGoogleTest(&argc, argv);
575  return RUN_ALL_TESTS();
576 }
grpc::ClientCompletedRpcsCumulative
const ::opencensus::stats::ViewDescriptor & ClientCompletedRpcsCumulative()
Definition: views.cc:134
grpc::ClientContext::census_context
struct census_context * census_context() const
Returns the census context that has been set, or nullptr if not set.
Definition: grpcpp/impl/codegen/client_context.h:378
grpc::EXPECT_THAT
EXPECT_THAT(status.error_message(), ::testing::HasSubstr("subject_token_type"))
testing::DoubleEq
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8634
census_context
struct census_context census_context
Definition: census.h:34
testing
Definition: aws_request_signer_test.cc:25
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
testing::Gt
internal::GtMatcher< Rhs > Gt(Rhs x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8591
testing::Lt
internal::LtMatcher< Rhs > Lt(Rhs x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8603
ctx
Definition: benchmark-async.c:30
generate.env
env
Definition: generate.py:37
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
metadata
Definition: cq_verifier.cc:48
server_address_
std::string server_address_
Definition: stats_plugin_end2end_test.cc:125
absl::Time
Definition: third_party/abseil-cpp/absl/time/time.h:642
grpc
Definition: grpcpp/alarm.h:33
TestServiceImpl::Echo
grpc::Status Echo(grpc::ServerContext *context, const grpc::testing::EchoRequest *request, grpc::testing::EchoResponse *response)
benchmark.request
request
Definition: benchmark.py:77
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::RegisterOpenCensusPlugin
void RegisterOpenCensusPlugin()
Definition: grpc_plugin.cc:42
grpc.StatusCode.ABORTED
tuple ABORTED
Definition: src/python/grpcio/grpc/__init__.py:274
grpc::ClientMethodTagKey
::opencensus::tags::TagKey ClientMethodTagKey()
Definition: grpc_plugin.cc:80
grpc::ClientSentMessagesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ClientSentMessagesPerRpcCumulative()
Definition: views.cc:145
ctx
static struct test_ctx ctx
Definition: test-ipc-send-recv.c:65
testing::Ge
internal::GeMatcher< Rhs > Ge(Rhs x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8585
absl::SleepFor
void SleepFor(absl::Duration duration)
Definition: abseil-cpp/absl/time/clock.h:70
start_time
static int64_t start_time
Definition: benchmark-getaddrinfo.c:37
second
StrT second
Definition: cxa_demangle.cpp:4885
grpc::CensusContext
Definition: cpp/ext/filters/census/context.h:44
grpc::ServerSentMessagesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ServerSentMessagesPerRpcCumulative()
Definition: views.cc:257
grpc::ClientContext::AddMetadata
void AddMetadata(const std::string &meta_key, const std::string &meta_value)
Definition: client_context.cc:121
grpc::ServerStatusTagKey
::opencensus::tags::TagKey ServerStatusTagKey()
Definition: grpc_plugin.cc:98
testing::Test
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:402
test_service_impl.h
testing::ElementsAre
internal::ElementsAreMatcher< ::testing::tuple<> > ElementsAre()
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13040
tags
bool tags[kAvailableTags]
Definition: inproc_callback_test.cc:114
testing::Property
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8732
absl::Milliseconds
constexpr Duration Milliseconds(T n)
Definition: third_party/abseil-cpp/absl/time/time.h:415
grpc::ClientRetriesCumulative
const ::opencensus::stats::ViewDescriptor & ClientRetriesCumulative()
Definition: views.cc:175
stub_
std::unique_ptr< EchoTestService::Stub > stub_
Definition: stats_plugin_end2end_test.cc:130
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc::ClientRoundtripLatencyCumulative
const ::opencensus::stats::ViewDescriptor & ClientRoundtripLatencyCumulative()
Definition: views.cc:114
grpc::ClientReceivedMessagesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ClientReceivedMessagesPerRpcCumulative()
Definition: views.cc:155
grpc::ServerBuilder
A builder class for the creation and startup of grpc::Server instances.
Definition: grpcpp/server_builder.h:86
server_thread_
std::thread server_thread_
Definition: stats_plugin_end2end_test.cc:128
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
absl::ToDoubleMilliseconds
double ToDoubleMilliseconds(Duration d)
Definition: abseil-cpp/absl/time/duration.cc:593
client_method_name_
const std::string client_method_name_
Definition: stats_plugin_end2end_test.cc:122
testing::Eq
internal::EqMatcher< T > Eq(T x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8561
EchoServer
Definition: bm_opencensus_plugin.cc:41
grpc::ServerSentBytesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ServerSentBytesPerRpcCumulative()
Definition: views.cc:216
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
grpc++.h
grpc::CreateChannel
std::shared_ptr< Channel > CreateChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds)
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
opencensus.h
grpc::ServerReceivedBytesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ServerReceivedBytesPerRpcCumulative()
Definition: views.cc:226
grpc::ASSERT_NE
ASSERT_NE(creds_file_name, nullptr)
grpc::ClientReceivedBytesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ClientReceivedBytesPerRpcCumulative()
Definition: views.cc:104
testing::Pair
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:9152
server_method_name_
const std::string server_method_name_
Definition: stats_plugin_end2end_test.cc:123
grpc_plugin.h
grpc::ClientContext
Definition: grpcpp/impl/codegen/client_context.h:195
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
test_config.h
grpc::kRpcServerServerLatencyMeasureName
const ABSL_CONST_INIT absl::string_view kRpcServerServerLatencyMeasureName
Definition: grpc_plugin.cc:152
service_
EchoServer service_
Definition: stats_plugin_end2end_test.cc:126
server_
std::unique_ptr< grpc::Server > server_
Definition: stats_plugin_end2end_test.cc:127
absl::Now
ABSL_NAMESPACE_BEGIN Time Now()
Definition: abseil-cpp/absl/time/clock.cc:39
grpc::ClientTransparentRetriesCumulative
const ::opencensus::stats::ViewDescriptor & ClientTransparentRetriesCumulative()
Definition: views.cc:195
grpc::ClientSentBytesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ClientSentBytesPerRpcCumulative()
Definition: views.cc:94
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
opencensus.proto.stats.v1.stats_pb2.View
View
Definition: stats_pb2.py:445
grpc::kRpcClientRoundtripLatencyMeasureName
const ABSL_CONST_INIT absl::string_view kRpcClientRoundtripLatencyMeasureName
Definition: grpc_plugin.cc:120
grpc::testing::TEST_F
TEST_F(ChannelArgumentsTest, SetInt)
Definition: channel_arguments_test.cc:134
grpc::ServerServerLatencyCumulative
const ::opencensus::stats::ViewDescriptor & ServerServerLatencyCumulative()
Definition: views.cc:236
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
GRPC_ARG_SERVICE_CONFIG
#define GRPC_ARG_SERVICE_CONFIG
Definition: grpc_types.h:304
TestServiceImpl::BidiStream
grpc::Status BidiStream(grpc::ServerContext *context, grpc::ServerReaderWriter< grpc::testing::EchoResponse, grpc::testing::EchoRequest > *stream)
testing::Le
internal::LeMatcher< Rhs > Le(Rhs x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8597
grpc::ServerCompletedRpcsCumulative
const ::opencensus::stats::ViewDescriptor & ServerCompletedRpcsCumulative()
Definition: views.cc:246
grpc::ClientStatusTagKey
::opencensus::tags::TagKey ClientStatusTagKey()
Definition: grpc_plugin.cc:86
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
grpc::ServerMethodTagKey
::opencensus::tags::TagKey ServerMethodTagKey()
Definition: grpc_plugin.cc:92
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
grpc::ClientContext::set_census_context
void set_census_context(struct census_context *ccp)
Definition: grpcpp/impl/codegen/client_context.h:375
grpc::ServerReceivedMessagesPerRpcCumulative
const ::opencensus::stats::ViewDescriptor & ServerReceivedMessagesPerRpcCumulative()
Definition: views.cc:267
grpc::CreateCustomChannel
std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
ASSERT_TRUE
#define ASSERT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1973
testing::UnorderedElementsAre
internal::UnorderedElementsAreMatcher< ::testing::tuple<> > UnorderedElementsAre()
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13255
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::testing::EXPECT_EQ
EXPECT_EQ(options.token_exchange_service_uri, "https://foo/exchange")
grpc::InsecureServerCredentials
std::shared_ptr< ServerCredentials > InsecureServerCredentials()
Definition: insecure_server_credentials.cc:52
testing::AllOf
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13472
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
testing::UnorderedElementsAreArray
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > UnorderedElementsAreArray(Iter first, Iter last)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8507
main
int main(int argc, char **argv)
Definition: stats_plugin_end2end_test.cc:572
grpc::testing::EXPECT_TRUE
EXPECT_TRUE(grpc::experimental::StsCredentialsOptionsFromJson(minimum_valid_json, &options) .ok())
grpc::InsecureChannelCredentials
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
Definition: cpp/client/insecure_credentials.cc:69
TestServiceImpl
Definition: interop_server.cc:139
google::protobuf::python::descriptor::Count
static PyObject * Count(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:694
testing::Contains
internal::ContainsMatcher< M > Contains(M matcher)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:9101
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc::testing::CheckMetadata
bool CheckMetadata(const std::multimap< grpc::string_ref, grpc::string_ref > &map, const string &key, const string &value)
Definition: interceptors_util.cc:184
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
context.h
grpc::ClientServerLatencyCumulative
const ::opencensus::stats::ViewDescriptor & ClientServerLatencyCumulative()
Definition: views.cc:124
grpc::ClientRetryDelayPerCallCumulative
const ::opencensus::stats::ViewDescriptor & ClientRetryDelayPerCallCumulative()
Definition: views.cc:205
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:17