Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1.  
  2. > Hi Xiaoyan,
  3. >
  4. > The "policy" that I was talking about is just a way to get access to the
  5. > underlying data structure (insert/erase events).
  6. >
  7. > In any case, as it could be a generally useful metric, I decided to
  8. > implement the necessary mechanics myself. If you're curious, you can
  9. > check commit 8566f458f2aacc25f06683ce00219f7168ee71f5, in particular
  10. > utils/trie/lifetime-stats-policy.h policy file.
  11. >
  12. > As of right now (commit f4a0359ac1dc60390ea41d8347c73a8c24a6789e) you can
  13. > use the following code in order to get samples for lifetime of cached
  14. > entries (copy from http://ndnsim.net/helpers.html#content-store):
  15. >
  16. > --------------------
  17. > void
  18. > CacheEntryRemoved (std::string context, Ptr<const ndn::cs::Entry> entry,
  19. > Time lifetime)
  20. > {
  21. > std::cout << entry->GetName () << " " << lifetime.ToDouble (Time::S)
  22. > << "s" << std::endl;
  23. > }
  24. > ...
  25. > ndnHelper.SetContentStore ("ns3::ndn::cs::Stats::Lru", "MaxSize", "10000");
  26. > ...
  27. > ndnHelper.Install (nodes);
  28. > // connect to lifetime trace
  29. > Config::Connect ("/NodeList/*/$ns3::ndn::cs::Stats::Lru/WillRemoveEntry",
  30. > MakeCallback (CacheEntryRemoved));
  31. > --------------------
  32. >
  33. > I haven't had time, but you can write a tracer (similar to the one you
  34. > already wrote for CacheHits/CacheMisses), which will make tracing totally
  35. > trivial.
  36. >
  37. > Please note, that you *have to* use a specialized version of content store
  38. > (ns3::ndn::cs::Stats::Lru, ns3::ndn::cs::Stats::Random, or
  39. > ns3::ndn::cs::Stats::Fifo), and
  40. > Config::Connect/Config::ConnectWithoutContext *have to* specify the correct
  41. > content store implementation.
  42. >
  43. > Another note, for some replacement policies, entries may not be put in
  44. > cache at all. In the current implementation, such entries will be reported
  45. > with lifetime 0.
  46. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement