[ndnSIM] Periodic tracing of CS

Alex Afanasyev alexander.afanasyev at ucla.edu
Wed Apr 23 16:08:11 PDT 2014


Hi André,

You can write something like this in your scenario:

    void
    printCsStats(Ptr<Node> node)
    {
      Ptr<ContentStore> cs = node->GetObject<ContentStore>();
    
      std::cout << Simulator::Now() << ", " << cs->GetSize() << std::endl;
    
      Simulator::Schedule(Seconds(5), &printCsStats, node);
    }
    
    ...
    
    Simulator::Schedule(Seconds(5), &printCsStats, node);

If you need per-prefix, then each time you have to enumerate all content items using Begin(), End(), and Next() ContentStore methods and calculate these stats before printing out.

---
Alex


On Apr 23, 2014, at 1:17 PM, André Luiz Nasserala Pires <nasserala at gmail.com> wrote:

> Hi,
> 
> I'm needing to implement a way to periodically capture the CS occupation of a node for a given prefix. Could anyone help me on this?
> 
> Example:
> 
> 
> time  |   #of contents  |  prefix            |   Node
> --------------------------------------------------------------
> 1       | 23                   | /prefix_test    |   RTR01
> 5       | 28                   | /prefix_test    |   RTR01
> 10     | 38                   | /prefix_test    |   RTR01
> 15     | 39                   | /prefix_test    |   RTR01
> 20     | 43                   | /prefix_test    |   RTR01
> 
> 
> .....
> 
> -- 
> _________________________________________
> Prof. Msc. André Luiz Nasserala Pires
> Analista de Sistemas
> Esp. em Redes de Computadores
> LPIC-1 / Novell CLA / RHEL5 / CCNA1-2
> +55 (68) 9979-6658
> Currículo Lattes:
> http://lattes.cnpq.br/2566007433985008
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20140423/c56157d0/attachment.html>


More information about the ndnSIM mailing list