Skip to content

Commit 5c6eec2

Browse files
committed
formatted the files
1 parent cbeec75 commit 5c6eec2

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414

1515
#include "google/cloud/storage/internal/async/object_descriptor_connection_tracing.h"
16-
#include "google/cloud/storage/internal/async/reader_connection_tracing.h"
1716
#include "google/cloud/storage/async/reader_connection.h"
17+
#include "google/cloud/storage/internal/async/reader_connection_tracing.h"
1818
#include "google/cloud/internal/opentelemetry.h"
1919
#include "google/cloud/version.h"
2020
#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY
@@ -59,9 +59,7 @@ class AsyncObjectDescriptorConnectionTracing
5959
{{sc::kThreadId, internal::CurrentThreadId()},
6060
{"read-start", p.start},
6161
{"read-length", p.length}});
62-
return MakeTracingReaderConnection(
63-
span_,
64-
std::move(result));
62+
return MakeTracingReaderConnection(span_, std::move(result));
6563
}
6664

6765
private:

google/cloud/storage/internal/async/object_descriptor_connection_tracing_test.cc

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ namespace {
3434
using ReadResponse =
3535
::google::cloud::storage_experimental::AsyncReaderConnection::ReadResponse;
3636
using ::google::cloud::storage_experimental::ObjectDescriptorConnection;
37+
using ::google::cloud::storage_experimental::ReadPayload;
3738
using ::google::cloud::storage_mocks::MockAsyncObjectDescriptorConnection;
3839
using ::google::cloud::storage_mocks::MockAsyncReaderConnection;
39-
using ::google::cloud::storage_experimental::ReadPayload;
4040
using ::google::cloud::testing_util::EventNamed;
4141
using ::google::cloud::testing_util::InstallSpanCatcher;
4242
using ::google::cloud::testing_util::OTelAttribute;
4343
using ::google::cloud::testing_util::OTelContextCaptured;
44-
using ::google::cloud::testing_util::ThereIsAnActiveSpan;
4544
using ::google::cloud::testing_util::PromiseWithOTelContext;
4645
using ::google::cloud::testing_util::SpanEventAttributesAre;
4746
using ::google::cloud::testing_util::SpanHasInstrumentationScope;
4847
using ::google::cloud::testing_util::SpanKindIsClient;
4948
using ::google::cloud::testing_util::SpanNamed;
5049
using ::google::cloud::testing_util::SpanWithStatus;
50+
using ::google::cloud::testing_util::ThereIsAnActiveSpan;
5151
using ::testing::_;
5252

5353
// A helper to set expectations on a mock async reader. It captures the OTel
@@ -103,7 +103,8 @@ TEST(ObjectDescriptorConnectionTracing, ReadThenRead) {
103103
namespace sc = ::opentelemetry::trace::SemanticConventions;
104104
auto span_catcher = InstallSpanCatcher();
105105

106-
auto mock_connection = std::make_shared<MockAsyncObjectDescriptorConnection>();
106+
auto mock_connection =
107+
std::make_shared<MockAsyncObjectDescriptorConnection>();
107108
auto* mock_reader_ptr = new MockAsyncReaderConnection;
108109
PromiseWithOTelContext<ReadResponse> p;
109110
EXPECT_CALL(*mock_reader_ptr, Read).WillOnce(expect_context(p));
@@ -126,27 +127,25 @@ TEST(ObjectDescriptorConnectionTracing, ReadThenRead) {
126127

127128
auto spans = span_catcher->GetSpans();
128129
EXPECT_THAT(
129-
spans,
130-
ElementsAre(AllOf(
131-
SpanNamed("test-span"),
132-
SpanWithStatus(opentelemetry::trace::StatusCode::kOk),
133-
SpanHasInstrumentationScope(), SpanKindIsClient(),
134-
SpanHasEvents(
135-
AllOf(EventNamed("gl-cpp.open.read"),
136-
SpanEventAttributesAre(
137-
OTelAttribute<std::int64_t>("read-length", 0),
138-
OTelAttribute<std::int64_t>("read-start", 0),
139-
OTelAttribute<std::string>(sc::kThreadId, _))),
140-
AllOf(
141-
EventNamed("gl-cpp.read"),
142-
SpanEventAttributesAre(
143-
OTelAttribute<std::int64_t>("message.starting_offset",
144-
123),
145-
OTelAttribute<std::string>(sc::kThreadId, _),
146-
OTelAttribute<std::int64_t>("rpc.message.id", 1),
147-
// THIS WAS THE MISSING ATTRIBUTE:
148-
OTelAttribute<std::string>("rpc.message.type",
149-
"RECEIVED")))))));
130+
spans, ElementsAre(AllOf(
131+
SpanNamed("test-span"),
132+
SpanWithStatus(opentelemetry::trace::StatusCode::kOk),
133+
SpanHasInstrumentationScope(), SpanKindIsClient(),
134+
SpanHasEvents(
135+
AllOf(EventNamed("gl-cpp.open.read"),
136+
SpanEventAttributesAre(
137+
OTelAttribute<std::int64_t>("read-length", 0),
138+
OTelAttribute<std::int64_t>("read-start", 0),
139+
OTelAttribute<std::string>(sc::kThreadId, _))),
140+
AllOf(EventNamed("gl-cpp.read"),
141+
SpanEventAttributesAre(
142+
OTelAttribute<std::int64_t>(
143+
"message.starting_offset", 123),
144+
OTelAttribute<std::string>(sc::kThreadId, _),
145+
OTelAttribute<std::int64_t>("rpc.message.id", 1),
146+
// THIS WAS THE MISSING ATTRIBUTE:
147+
OTelAttribute<std::string>("rpc.message.type",
148+
"RECEIVED")))))));
150149
}
151150

152151
} // namespace

0 commit comments

Comments
 (0)