Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Add JSON support to the mock tracer. #48

Merged
merged 48 commits into from
Jan 22, 2018

Conversation

rnburn
Copy link
Contributor

@rnburn rnburn commented Jan 17, 2018

Adds support for serializing/deserializing mock spans to/from JSON.

This will be useful for testing dynamic loading scenarios where there is no direct access to the InMemoryRecorder API.

@rnburn rnburn changed the title Mocktracer json Add JSON support to the mock tracer. Jan 17, 2018
@rnburn
Copy link
Contributor Author

rnburn commented Jan 22, 2018

@isaachier -- look ok?

Copy link
Contributor

@isaachier isaachier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one minor suggestion.

BEGIN_OPENTRACING_ABI_NAMESPACE
namespace mocktracer {
// Serialize provided spans to JSON.
std::string ToJson(const std::vector<SpanData>& spans);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want better nlohmann/JSON support, put this in the nlohmann namespace as described in the docs there. That allows for native conversion to/from JSON types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind see you did it later.

@rnburn rnburn merged commit 359bafe into opentracing:master Jan 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants