1

After my research I decided to log from each component for every request: time, localization and some kind of request-ID. Then take it all together and sort by ID. Then I can have information how long does it take to go through single component for each request, what is exactly what I need.

My problem is I don't know how to pass ID across the system (threads are created e.g. by RMI). My idea was to set the same thread name to all threads connected to one request (see discusion here), but I still need some advice how to do this. Or maybe there is better idea to gather threads together?

Community
  • 1
  • 1
alicjasalamon
  • 4,171
  • 15
  • 41
  • 65
  • Can you provide some more backgroup @trebuchet? What components? What sort of system is this? Why are you doing this? The 2nd paragraph is confusing and should probably be deleted. Just explain _clearly_ what you are trying to accomplish _without_ providing a solution. Thread-ids are _not_ the way to go. – Gray Jul 30 '12 at 15:07
  • What do you pass to new threads created by RMI? What input? – Mikita Belahlazau Jul 30 '12 at 15:08
  • any thread local information is only going to be available within a single jvm, so this won't help much for a distributed system (unless you only care about tracking the client side). – jtahlborn Jul 30 '12 at 15:08

1 Answers1

1

The way I have done this is to pass a String containing a timestamp of all the key steps in the process. At the end I have a complete end-to-end record of all the timing. This means passing an extra argument, but since the reporting is much simpler it can be worth it.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130