1
  1. I have a sending application that sends a command via an anonymous pipe.
  2. I have a receiving application that receives the command, handles it, and returns a result.
  3. The sending application receives the result.

I can time the length of the complete operation in the first application (steps 1-3). I can also time the handling of the second application that executes the command (step 2).

Looking at both logs I can subtract the time for step 2 form the time of step 1-3 and assuming that the sending application doesn't waste any time, I now know how many time for the transfer was used. Is there any way, that I can sync both logs in some way, that both logs show the same time-token in msecs. Or to sync all operations in some way, that I can see all timing in the log of the first application.

I know that the applications need some special commands to sync them in some way. But this would be possible, but I have no clue if this is possible at all.

Or the question in other words: Is it possible to time everything in application 1 without looking on both logs individually.

Best possible result:

  1. I know the time that is used for the i/o (pipe)
  2. Time of code executed in app 2 (without i/o)
  3. Time of code executed in app 1 (without i/o)

Further information: The applications run on different machines. Even in different networks connected via VPN.

xMRi
  • 14,982
  • 3
  • 26
  • 59
  • 1
    They're both running on the same machine, so their system_clock and high_resolution_clock should be in sync. As you're passing messages, you can build up a series of time_points. But the pipe is going to be exceedingly fast, and it might take high_resolution_clock to measure it. But just keep passing the time_points along, letting your message grow. – Joseph Larson May 18 '22 at 12:13
  • linux: clock_gettime. windows: QueryPerformanceCounter – user253751 May 18 '22 at 13:37
  • The applications run on different machines. Even in diffreent networks connected via VPN. – xMRi May 19 '22 at 07:38

1 Answers1

0

Similar to what Joseph Larson suggested, but without concern of clocks to be synchronized: could you just append a time spent in app 2 to the result it returns? Then log it from app 1, together with total time.

Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27