<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Amin,<div><br></div><div>First, I want to emphasize that function PeriodicStatsPrinter is just a very rough example, which should not really be a primary mechanism to get samples (and it doesn't not appear in the most samples).  The right way is either using the existing trace helper or creating a custom trace helper for the purpose of the metric collection.</div><div><br></div><div>As for your question.  You definitely need to implement a new trace helper that you will associate with each node that you need to collect stats from.  There are many ways of how it can exactly be done.  For cache tracing, there is already a ndn::CsTrace helper (<a href="http://ndnsim.net/metric.html#content-store-trace-helper">http://ndnsim.net/metric.html#content-store-trace-helper</a>).  For PIT tracing, you may need to write something similar (but you also need to extend PIT interface and provide necessary TraceSource hooks).</div><div><br></div><div>For PIT tracing you can also rely on ...AggregateStats... policy (I guess, these are the examples you're referring to).</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Dec 19, 2013, at 4:58 AM, Amin Karami <<a href="mailto:amin@ac.upc.edu">amin@ac.upc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Dear Alex and ndnSIM users,<br>
    <br>
    How we can count and print the rate of the <b>Cache hit and PIT
      entry per interface in each second</b>?<br>
    such as "void PeriodicStatsPrinter ()" function which appears in
    most samples of ndnSIM scenarios.<br>
    <br>
    <br>
    /Amin<br>
  </div>

_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></div></body></html>