<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yes, that's what I am suspecting too. If there are several interest, then the final diff time will be the aggregated time from beginning till the final schedule. This can incur a false/high number than expected if the computation is for per interest. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Saurab,</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Junxiao Shi <shijunxiao@email.arizona.edu><br>
<b>Sent:</b> Wednesday, September 9, 2020 2:32 PM<br>
<b>To:</b> Saurab Dulal (sdulal) <sdulal@memphis.edu><br>
<b>Cc:</b> Anurag Muttur via Mini-NDN <mini-ndn@lists.cs.ucla.edu><br>
<b>Subject:</b> Re: [EXT]Re: [Mini-NDN] Problems measuring elapsed time in MiniNDN experiment</font>
<div> </div>
</div>
<div>
<div dir="auto">Hi Saurab<br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I think OP is recording the end time after face.processEvents() returns.</div>
<div dir="auto">This is unusual but valid according to API: face.processEvents() should block until there’s nothing scheduled on the asio::io_context. This means, suppose this is the only Interest on the face, face.processEvent() should return when the Interest
 is either satisfied or expired.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I don’t know what’s causing the problem though.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Yours, Junxiao</div>
<div><br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Sep 9, 2020 at 15:20 Saurab Dulal (sdulal) <<a href="mailto:sdulal@memphis.edu">sdulal@memphis.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div dir="ltr">
<p style="text-align:center"><font color="red"><strong>External Email</strong><br>
</font></p>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
Hi Anurag, </div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
Where are you computing "m_sTimeDiff"? are you computing it inside the callback? if the data is received, "onData" should be called and I assume you are computing it there? If not, you will not get the right value.</div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
Additionally, you can also use NDN_LOG. For every log message, it begins with a Unix timestamp which you can use to compute the time difference (this is what I do most of the time). </div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
Regards,</div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
Saurab Dulal</div>
<br>
<br>
<div id="x_m_-1077373382327947386Signature"><br>
<br>
<div><br>
<br>
<div id="x_m_-1077373382327947386divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
<br>
</div>
<br>
<br>
</div>
<br>
<br>
</div>
<br>
<br>
<div id="x_m_-1077373382327947386appendonsend"></div>
<br>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
<hr style="display:inline-block; width:98%">
<br>
<br>
<div id="x_m_-1077373382327947386divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mini-NDN <<a href="mailto:mini-ndn-bounces@lists.cs.ucla.edu" target="_blank">mini-ndn-bounces@lists.cs.ucla.edu</a>>
 on behalf of Lan Wang (lanwang) <<a href="mailto:lanwang@memphis.edu" target="_blank">lanwang@memphis.edu</a>><br>
<br>
<br>
<b>Sent:</b> Tuesday, September 8, 2020 11:37 PM<br>
<br>
<br>
<b>To:</b> Anurag Muttur via Mini-NDN <<a href="mailto:mini-ndn@lists.cs.ucla.edu" target="_blank">mini-ndn@lists.cs.ucla.edu</a>><br>
<br>
<br>
<b>Subject:</b> [Mini-NDN] Problems measuring elapsed time in MiniNDN experiment</font><br>
<br>
<div> </div>
<br>
<br>
</div>
</div>
<div dir="ltr"><br>
<br>
<div style="word-wrap:break-word; line-break:after-white-space"><br>
<br>
<br>
<div><br>
<br>
<br>
<blockquote type="cite"><br>
<br>
<div>Begin forwarded message:</div>
<br>
<br>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
<br>
<br>
<br>
<div>The attached message has been automatically discarded.<br>
<br>
<br>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br>
<br>
<span style="color:rgba(127,127,127,1.0)"><b>From: </b></span><span>Andre Dexheimer Carneiro <<a href="mailto:andre.dexheimer@inf.ufrgs.br" target="_blank">andre.dexheimer@inf.ufrgs.br</a>><br>
<br>
<br>
</span></div>
<br>
<br>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br>
<br>
<span style="color:rgba(127,127,127,1.0)"><b>Subject: </b></span><span><b>Problems measuring elapsed time in MiniNDN experiment</b><br>
<br>
<br>
</span></div>
<br>
<br>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br>
<br>
<span style="color:rgba(127,127,127,1.0)"><b>Date: </b></span><span>September 8, 2020 at 9:41:38 PM CDT<br>
<br>
<br>
</span></div>
<br>
<br>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br>
<br>
<span style="color:rgba(127,127,127,1.0)"><b>To: </b></span><span><a href="mailto:mini-ndn@lists.cs.ucla.edu" target="_blank">mini-ndn@lists.cs.ucla.edu</a><br>
<br>
<br>
</span></div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Hi,<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
I am writing an experiment which instantiates NDN producers and consumers as an attempt to simulate a specific scenario with multiple hosts. However, I can't seem to measure the elapsed time correctly, my code right now is:<br>
<br>
<br>
<br>
<br>
<br>
-----<br>
<br>
<br>
  dtBegin   = std::chrono::steady_clock::now();<br>
<br>
<br>
  m_face.expressInterest(interest, bind(&Consumer::onData, this,   _1, _2),<br>
<br>
<br>
     bind(&Consumer::onNack, this, _1, _2), bind(&Consumer::onTimeout, this, _1));<br>
<br>
<br>
<br>
<br>
<br>
  // processEvents will block until the requested data is received or a timeout occurs<br>
<br>
<br>
  m_face.processEvents();<br>
<br>
<br>
<br>
<br>
<br>
  dtEnd       = std::chrono::steady_clock::now();<br>
<br>
<br>
  m_sTimeDiff = std::chrono::duration_cast<std::chrono::microseconds>(dtEnd - dtBegin).count();\<br>
<br>
<br>
-----<br>
<br>
<br>
<br>
<br>
<br>
Everything seems to work fine, with nodes receiving and sending data as they should, however the recorded times are usually at around 1000 us, which is completely unrealistic as the links have between 2ms and 1000ms delay in my topology. Could anybody cast<br>
<br>
some light into how to get this metric correctly?<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Thanks in advance.<br>
<br>
<br>
<br>
<br>
<br>
André Dexheimer Carneiro<br>
<br>
<br>
Computer Enginnering - UFRGS<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
</blockquote>
<br>
<br>
</div>
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
</div>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<br>
Mini-NDN mailing list<br>
<br>
<a href="mailto:Mini-NDN@lists.cs.ucla.edu" target="_blank">Mini-NDN@lists.cs.ucla.edu</a><br>
<br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn</a><br>
<br>
</blockquote>
</div>
</div>
</div>
</body>
</html>