Permalink
Browse files

print() for spans.

  • Loading branch information...
1 parent 1ad4fda commit 8b2a3c9826c6a60254a16ca0da8a32e6c9a9e2ac @mariusae mariusae committed Feb 18, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 finagle-core/src/main/scala/com/twitter/finagle/tracing/Trace.scala
View
11 finagle-core/src/main/scala/com/twitter/finagle/tracing/Trace.scala
@@ -55,6 +55,15 @@ case class Span(
Span.timeFormat.format(startTime),
(endTime - startTime).inMilliseconds)
}
+
+ def print() {
+ transcript foreach { record =>
+ val atMs = (record.timestamp - startTime).inMilliseconds
+ record.message.split("\n") foreach { line =>
+ println("%s %03dms: %s".format(traceID, atMs, line))
+ }
+ }
+ }
}
object Trace {
@@ -80,7 +89,7 @@ object Trace {
def clear() {
current.clear()
}
-
+
def startSpan() {
this() = newSpan()
}

0 comments on commit 8b2a3c9

Please sign in to comment.