Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void add(MetricKey key, AggregateMetric aggregate) {
writer.writeBoolean(key.isSynthetics());

writer.writeUTF8(IS_TRACE_ROOT);
writer.writeBoolean(key.isTraceRoot());
writer.writeInt(key.isTraceRoot() ? 1 : 2); // tristate (0 unknown, 1 true, 2 false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: Might be useful to represent the tri state by constants


writer.writeUTF8(SPAN_KIND);
writer.writeUTF8(key.getSpanKind());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class SerializingMetricWriterTest extends DDSpecification {
assert unpacker.unpackBoolean() == key.isSynthetics()
++elementCount
assert unpacker.unpackString() == "IsTraceRoot"
assert unpacker.unpackBoolean() == key.isTraceRoot()
assert unpacker.unpackInt() == (key.isTraceRoot() ? 1 : 2)
++elementCount
assert unpacker.unpackString() == "SpanKind"
assert unpacker.unpackString() == key.getSpanKind() as String
Expand Down