Fix trace time format, add end time

This commit is contained in:
Lukas Joswiak 2020-07-23 14:33:51 -07:00
parent 37009e34de
commit 26661d0657
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,9 @@ struct LogfileTracer : ITracer {
TracerType type() const { return TracerType::LOG_FILE; }
void trace(Span const& span) override {
TraceEvent te(SevInfo, "TracingSpan", span.context);
te.detail("Location", span.location.name).detail("Begin", span.begin).detail("End", span.end);
te.detail("Location", span.location.name)
.detail("Begin", format("%.6f", span.begin))
.detail("End", format("%.6f", span.end));
if (span.parents.size() == 1) {
te.detail("Parent", *span.parents.begin());
} else {
@ -79,6 +81,7 @@ Span& Span::operator=(Span&& o) {
Span::~Span() {
if (begin > 0.0) {
end = g_network->now();
g_tracer->trace(*this);
}
}