Skip to content

Commit

Permalink
reporter endpoint backward compat (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shikugawa authored Mar 17, 2021
1 parent 6b068ba commit cb5ec3d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 16 deletions.
2 changes: 2 additions & 0 deletions cpp2sky/internal/async_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ struct StreamCallbackTag {
case StreamState::ReadDone:
callback_->onReadDone();
break;
default:
break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
name = "tracer_example",
name = "sample",
srcs = ["sample.cc"],
deps = [
"//cpp2sky:cpp2sky_interface",
Expand All @@ -11,7 +11,7 @@ cc_binary(
)

cc_binary(
name = "tracer_client_example",
name = "sample_client",
srcs = ["sample_client.cc"],
deps = [
"//cpp2sky:cpp2sky_interface",
Expand Down
3 changes: 1 addition & 2 deletions source/grpc_async_client_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ GrpcAsyncSegmentReporterStream::GrpcAsyncSegmentReporterStream(
ctx_.set_wait_for_ready(true);

request_writer_ = client_.stub().PrepareCall(
&ctx_, "/skywalking.v3.TraceSegmentReportService/collect",
&client_.completionQueue());
&ctx_, "/TraceSegmentReportService/collect", &client_.completionQueue());
request_writer_->StartCall(reinterpret_cast<void*>(&ready_));
}

Expand Down
4 changes: 2 additions & 2 deletions source/propagation_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SpanContextImpl::SpanContextImpl(std::string_view header_value) {
size_t current_field_idx = 0;
std::string value;

for (auto i = 0; i < header_value.size(); ++i) {
for (size_t i = 0; i < header_value.size(); ++i) {
if (current_field_idx >= EXPECTED_FIELD_COUNT) {
throw TracerException(
"Invalid span context format. It must have 8 fields.");
Expand Down Expand Up @@ -78,7 +78,7 @@ SpanContextExtensionImpl::SpanContextExtensionImpl(
size_t current_field_idx = 0;
std::string value;

for (auto i = 0; i < header_value.size(); ++i) {
for (size_t i = 0; i < header_value.size(); ++i) {
if (current_field_idx >= EXPECTED_EXTENSION_FIELD_COUNT) {
throw TracerException(
"Invalid span context format. It must have 1 fields.");
Expand Down
6 changes: 0 additions & 6 deletions source/tracing_context_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class TracingSpanImpl : public TracingSpan {

skywalking::v3::SpanObject createSpanObject() override;

#pragma region Getters
int32_t spanId() const override { return span_id_; }
int32_t parentSpanId() const override { return parent_span_id_; }
int64_t startTime() const override { return start_time_; }
Expand All @@ -47,9 +46,7 @@ class TracingSpanImpl : public TracingSpan {
}
bool finished() const override { return finished_; }
std::string operationName() const override { return operation_name_; }
#pragma endregion

#pragma region Setters
void setParentSpanId(int32_t span_id) override {
assert(!finished_);
parent_span_id_ = span_id;
Expand Down Expand Up @@ -86,7 +83,6 @@ class TracingSpanImpl : public TracingSpan {
void addLog(std::string key, std::string value,
TimePoint<SteadyTime> current_time) override;
void setComponentId(int32_t component_id) override;
#pragma endregion

private:
// Based on
Expand Down Expand Up @@ -127,7 +123,6 @@ class TracingContextImpl : public TracingContext {
SpanContextExtensionPtr parent_ext_span_context,
RandomGenerator& random);

#pragma region Getters
const std::string& traceId() const override { return trace_id_; }
const std::string& traceSegmentId() const override {
return trace_segment_id_;
Expand All @@ -143,7 +138,6 @@ class TracingContextImpl : public TracingContext {
SpanContextExtensionPtr parentSpanContextExtension() const override {
return parent_ext_span_context_;
}
#pragma endregion

TracingSpanPtr createExitSpan(TracingSpanPtr parent_span) override;

Expand Down
2 changes: 0 additions & 2 deletions source/utils/circular_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ class CircularBuffer {
size_t size() const { return item_count_; }

// Used for test
#pragma region test
size_t frontIdx() { return front_; }
size_t backIdx() { return back_; }
#pragma endregion

private:
void popInternal() {
Expand Down
2 changes: 0 additions & 2 deletions test/grpc_async_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include "source/grpc_async_client_impl.h"
#include "test/mocks.h"

#define TEST

namespace cpp2sky {

using testing::_;
Expand Down

0 comments on commit cb5ec3d

Please sign in to comment.