diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2013-11-29 09:59:37 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2013-11-29 09:59:37 -0300 |
commit | 231b5b0fc61438ec96e309436295e86808abdbb5 (patch) | |
tree | 10288215da3562b5d523b4d2d97b703056cfe4fa /kamon-trace/src/main/scala/kamon/trace/Trace.scala | |
parent | b80e4bd135ed50b01def5a4c2f7c42983efb54fd (diff) | |
download | Kamon-231b5b0fc61438ec96e309436295e86808abdbb5.tar.gz Kamon-231b5b0fc61438ec96e309436295e86808abdbb5.tar.bz2 Kamon-231b5b0fc61438ec96e309436295e86808abdbb5.zip |
instrumentation is back in place
Diffstat (limited to 'kamon-trace/src/main/scala/kamon/trace/Trace.scala')
-rw-r--r-- | kamon-trace/src/main/scala/kamon/trace/Trace.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kamon-trace/src/main/scala/kamon/trace/Trace.scala b/kamon-trace/src/main/scala/kamon/trace/Trace.scala index 02947dd6..6eff69e5 100644 --- a/kamon-trace/src/main/scala/kamon/trace/Trace.scala +++ b/kamon-trace/src/main/scala/kamon/trace/Trace.scala @@ -61,9 +61,18 @@ object Trace extends ExtensionId[TraceExtension] with ExtensionIdProvider { // TODO: FIX def newTraceContext(name: String)(implicit system: ActorSystem): TraceContext = TraceContext(Kamon(Trace), tranid.getAndIncrement, name) + def startSegment(category: Segments.Category, description: String = "", attributes: Map[String, String] = Map()): SegmentCompletionHandle = { + val start = Segments.Start(category, description, attributes) + SegmentCompletionHandle(start) + } + def startSegment(start: Segments.Start): SegmentCompletionHandle = SegmentCompletionHandle(start) case class SegmentCompletionHandle(start: Segments.Start) { + def complete(): Unit = { + val end = Segments.End() + println(s"Completing the Segment: $start - $end") + } def complete(end: Segments.End): Unit = { println(s"Completing the Segment: $start - $end") } |