Hi, Ivan
Thanks for your reply!
Could you give me some concrete code example on how to set/get a object via
TraceLocal?
for example, assuming I have below receiver in an actor:
...
case request: HttpRequest =>
become(handleAppRequest(request))
IO(Http) ! settings.toHostConnectorSetup
TraceLocal.set(new MyObject())
def handleAppRequest(request: ProxyRequest): Receive = {
case HostConnectorInfo(actor, _) =>
actor ! request
case response: HttpResponse =>
TraceLocal.get() should return the previous MyObject?
//send back to client
}
As you can see from the code, I want to inject some information into
TraceLocal and retrieve it back when got response
How to do it?
Thanks
Leon
在 2014年6月3日星期二UTC-7上午9时17分34秒,Ivan Topolnjak写道:
>
> Leon,
>
> your use case is very similar to the one we had a long time ago when we
> started developing Kamon.. The TraceLocalStorage is attached to a
> TraceContext, which is something that we create and propagate for all
> events related to the processing of a request, and when I say all events
> I'm including future's body/callbacks and actor supervision messages, not
> just regular tell. Once you finish a Trace you get metrics on how long did
> it take to process the entire Trace.. You can start/finish a Trace
> manually, but if you are using Spray or Play! then Kamon knows how/when to
> start and finish the traces for you. Probably this [1] example can help you
> get a better feeling on how to do it manually. Each TraceContext has a
> trace token, that seems to be the equivalent of the UUIDs that you were
> previously using. Also, we have something called "Segments" which represent
> something similar to the inner transactions you were talking about and
> allow you to get metrics on how this pieces of code perform inside each
> request.. Let me know if you want to explore this further, regards!
>
>
> [1] http://kamon.io/core/tracing/
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.