简体   繁体   English

如何通过两个应用程序的 IPC 测量执行速度

[英]How to measure speed of an execution via IPC of two applications

  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).我可以在第一个应用程序中计算完整操作的长度(步骤 1-3)。 I can also time the handling of the second application that executes the command (step 2).我还可以计时处理执行命令的第二个应用程序(步骤 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.查看这两个日志,我可以从步骤 1-3 的时间中减去步骤 2 的时间,并假设发送应用程序没有浪费任何时间,我现在知道使用了多少时间进行传输。 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.或者换句话说,问题是:是否可以在不单独查看两个日志的情况下对应用程序 1 中的所有内容进行计时。

Best possible result:最好的结果:

  1. I know the time that is used for the i/o (pipe)我知道用于 i/o(管道)的时间
  2. Time of code executed in app 2 (without i/o)在应用程序 2 中执行的代码时间(没有 i/o)
  3. Time of code executed in app 1 (without i/o)应用程序 1 中执行的代码时间(无 i/o)

Further information: The applications run on different machines.更多信息:应用程序在不同的机器上运行。 Even in different networks connected via VPN.即使在通过 VPN 连接的不同网络中。

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?类似于 Joseph Larson 的建议,但无需担心时钟是否同步:您能否将在app 2中花费的时间附加到它返回的result中? Then log it from app 1 , together with total time.然后从app 1记录它以及总时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM