@@ -75,7 +75,10 @@ class StatsPluginEnd2EndTest : public ::testing::Test {
7575
7676 void RunServerLoop () { server_->Wait (); }
7777
78- const std::string method_name_ = " /opencensus.testing.EchoService/Echo" ;
78+ const std::string client_method_name_ =
79+ " Sent.opencensus.testing.EchoService/Echo" ;
80+ const std::string server_method_name_ =
81+ " Recv.opencensus.testing.EchoService/Echo" ;
7982
8083 std::string server_address_;
8184 EchoServer service_;
@@ -91,7 +94,6 @@ TEST_F(StatsPluginEnd2EndTest, ErrorCount) {
9194 .set_measure (kRpcClientErrorCountMeasureName )
9295 .set_name (" client_method" )
9396 .set_aggregation (stats::Aggregation::Sum ())
94-
9597 .add_column (kMethodTagKey );
9698 stats::View client_method_view (client_method_descriptor);
9799 const auto server_method_descriptor =
@@ -100,7 +102,7 @@ TEST_F(StatsPluginEnd2EndTest, ErrorCount) {
100102 .set_name (" server_method" )
101103 .set_aggregation (stats::Aggregation::Sum ())
102104 .add_column (kMethodTagKey );
103- stats::View server_method_view (client_method_descriptor );
105+ stats::View server_method_view (server_method_descriptor );
104106
105107 const auto client_status_descriptor =
106108 stats::ViewDescriptor ()
@@ -129,11 +131,11 @@ TEST_F(StatsPluginEnd2EndTest, ErrorCount) {
129131 absl::SleepFor (absl::Milliseconds (500 ));
130132
131133 EXPECT_THAT (client_method_view.GetData ().double_data (),
132- ::testing::UnorderedElementsAre (
133- ::testing::Pair (::testing:: ElementsAre(method_name_ ), 16.0)));
134+ ::testing::UnorderedElementsAre (::testing::Pair(
135+ ::testing::ElementsAre (client_method_name_ ), 16.0)));
134136 EXPECT_THAT (server_method_view.GetData().double_data(),
135- ::testing::UnorderedElementsAre(
136- ::testing::Pair (::testing:: ElementsAre(method_name_ ), 16.0)));
137+ ::testing::UnorderedElementsAre(::testing::Pair(
138+ ::testing::ElementsAre (server_method_name_ ), 16.0)));
137139
138140 auto codes = {
139141 ::testing::Pair (::testing::ElementsAre(" OK" ), 0.0),
@@ -181,28 +183,28 @@ TEST_F(StatsPluginEnd2EndTest, RequestResponseBytes) {
181183 EXPECT_THAT (
182184 client_request_bytes_view.GetData ().distribution_data (),
183185 ::testing::UnorderedElementsAre (::testing::Pair(
184- ::testing::ElementsAre (method_name_ ),
186+ ::testing::ElementsAre (client_method_name_ ),
185187 ::testing::AllOf(::testing::Property(&stats::Distribution::count, 1 ),
186188 ::testing::Property(&stats::Distribution::mean,
187189 ::testing::Gt (0.0 ))))));
188190 EXPECT_THAT (
189191 client_response_bytes_view.GetData().distribution_data(),
190192 ::testing::UnorderedElementsAre(::testing::Pair(
191- ::testing::ElementsAre (method_name_ ),
193+ ::testing::ElementsAre (client_method_name_ ),
192194 ::testing::AllOf(::testing::Property(&stats::Distribution::count, 1 ),
193195 ::testing::Property(&stats::Distribution::mean,
194196 ::testing::Gt (0.0 ))))));
195197 EXPECT_THAT (
196198 server_request_bytes_view.GetData().distribution_data(),
197199 ::testing::UnorderedElementsAre(::testing::Pair(
198- ::testing::ElementsAre (method_name_ ),
200+ ::testing::ElementsAre (server_method_name_ ),
199201 ::testing::AllOf(::testing::Property(&stats::Distribution::count, 1 ),
200202 ::testing::Property(&stats::Distribution::mean,
201203 ::testing::Gt (0.0 ))))));
202204 EXPECT_THAT (
203205 server_response_bytes_view.GetData().distribution_data(),
204206 ::testing::UnorderedElementsAre(::testing::Pair(
205- ::testing::ElementsAre (method_name_ ),
207+ ::testing::ElementsAre (server_method_name_ ),
206208 ::testing::AllOf(::testing::Property(&stats::Distribution::count, 1 ),
207209 ::testing::Property(&stats::Distribution::mean,
208210 ::testing::Gt (0.0 ))))));
@@ -234,7 +236,7 @@ TEST_F(StatsPluginEnd2EndTest, Latency) {
234236 EXPECT_THAT (
235237 client_latency_view.GetData ().distribution_data (),
236238 ::testing::UnorderedElementsAre (::testing::Pair(
237- ::testing::ElementsAre (method_name_ ),
239+ ::testing::ElementsAre (client_method_name_ ),
238240 ::testing::AllOf(::testing::Property(&stats::Distribution::count, 1 ),
239241 ::testing::Property(&stats::Distribution::mean,
240242 ::testing::Gt (0.0 )),
@@ -244,11 +246,11 @@ TEST_F(StatsPluginEnd2EndTest, Latency) {
244246 // Elapsed time is a subinterval of total latency.
245247 const auto client_latency = client_latency_view.GetData()
246248 .distribution_data()
247- .find({method_name_ })
249+ .find({client_method_name_ })
248250 ->second.mean();
249251 EXPECT_THAT (client_server_elapsed_time_view.GetData().distribution_data(),
250252 ::testing::UnorderedElementsAre(::testing::Pair(
251- ::testing::ElementsAre (method_name_ ),
253+ ::testing::ElementsAre (client_method_name_ ),
252254 ::testing::AllOf(
253255 ::testing::Property (&stats::Distribution::count, 1 ),
254256 ::testing::Property(&stats::Distribution::mean,
@@ -260,12 +262,12 @@ TEST_F(StatsPluginEnd2EndTest, Latency) {
260262 // client.
261263 const auto client_elapsed_time = client_server_elapsed_time_view.GetData()
262264 .distribution_data()
263- .find({method_name_ })
265+ .find({client_method_name_ })
264266 ->second.mean();
265267 EXPECT_THAT (
266268 server_server_elapsed_time_view.GetData().distribution_data(),
267269 ::testing::UnorderedElementsAre(::testing::Pair(
268- ::testing::ElementsAre (method_name_ ),
270+ ::testing::ElementsAre (server_method_name_ ),
269271 ::testing::AllOf(
270272 ::testing::Property (&stats::Distribution::count, 1 ),
271273 ::testing::Property(&stats::Distribution::mean,
@@ -293,16 +295,16 @@ TEST_F(StatsPluginEnd2EndTest, StartFinishCount) {
293295
294296 EXPECT_THAT (client_started_count_view.GetData ().double_data (),
295297 ::testing::UnorderedElementsAre (::testing::Pair(
296- ::testing::ElementsAre (method_name_ ), i + 1)));
298+ ::testing::ElementsAre (client_method_name_ ), i + 1)));
297299 EXPECT_THAT (client_finished_count_view.GetData().double_data(),
298300 ::testing::UnorderedElementsAre(::testing::Pair(
299- ::testing::ElementsAre (method_name_ ), i + 1)));
301+ ::testing::ElementsAre (client_method_name_ ), i + 1)));
300302 EXPECT_THAT (server_started_count_view.GetData().double_data(),
301303 ::testing::UnorderedElementsAre(::testing::Pair(
302- ::testing::ElementsAre (method_name_ ), i + 1)));
304+ ::testing::ElementsAre (server_method_name_ ), i + 1)));
303305 EXPECT_THAT (server_finished_count_view.GetData().double_data(),
304306 ::testing::UnorderedElementsAre(::testing::Pair(
305- ::testing::ElementsAre (method_name_ ), i + 1)));
307+ ::testing::ElementsAre (server_method_name_ ), i + 1)));
306308 }
307309}
308310
@@ -328,28 +330,28 @@ TEST_F(StatsPluginEnd2EndTest, RequestResponseCount) {
328330
329331 EXPECT_THAT (client_request_count_view.GetData ().distribution_data (),
330332 ::testing::UnorderedElementsAre (::testing::Pair(
331- ::testing::ElementsAre (method_name_ ),
333+ ::testing::ElementsAre (client_method_name_ ),
332334 ::testing::AllOf(
333335 ::testing::Property (&stats::Distribution::count, i + 1 ),
334336 ::testing::Property(&stats::Distribution::mean,
335337 ::testing::DoubleEq (1.0 ))))));
336338 EXPECT_THAT (client_response_count_view.GetData().distribution_data(),
337339 ::testing::UnorderedElementsAre(::testing::Pair(
338- ::testing::ElementsAre (method_name_ ),
340+ ::testing::ElementsAre (client_method_name_ ),
339341 ::testing::AllOf(
340342 ::testing::Property (&stats::Distribution::count, i + 1 ),
341343 ::testing::Property(&stats::Distribution::mean,
342344 ::testing::DoubleEq (1.0 ))))));
343345 EXPECT_THAT (server_request_count_view.GetData().distribution_data(),
344346 ::testing::UnorderedElementsAre(::testing::Pair(
345- ::testing::ElementsAre (method_name_ ),
347+ ::testing::ElementsAre (server_method_name_ ),
346348 ::testing::AllOf(
347349 ::testing::Property (&stats::Distribution::count, i + 1 ),
348350 ::testing::Property(&stats::Distribution::mean,
349351 ::testing::DoubleEq (1.0 ))))));
350352 EXPECT_THAT (server_response_count_view.GetData().distribution_data(),
351353 ::testing::UnorderedElementsAre(::testing::Pair(
352- ::testing::ElementsAre (method_name_ ),
354+ ::testing::ElementsAre (server_method_name_ ),
353355 ::testing::AllOf(
354356 ::testing::Property (&stats::Distribution::count, i + 1 ),
355357 ::testing::Property(&stats::Distribution::mean,
0 commit comments