Re: [Icarus] Get the number of cache hits of nodes

From: Saino, Lorenzo <l.saino_at_alumni.ucl.ac.uk>
Date: Mon, 23 Jan 2017 22:19:59 +0000

Hi Igor,


I see what you mean.


Collectors are not a good place to implement this functionality. The reason is that you are not only measuring some metrics, you also need your strategy implementation to act upon the metrics you are measuring. And there's no good way for a strategy implementation to access collectors' state.


I would suggest to implement all the logic inside your strategy, it shouldn't be too complex. Just create a dictionary mapping each caching node to two counters, one for the hits and one for the misses that you increment accordingly. Each time you need to deliver a content, you lookup the shortest path, iterate over the entries of the dictionary that are on the path and cache the object in the node with greatest hit ratio.


You may want to look at the CL4M implementation, which is probably the strategy whose implementation is most similar to what you're trying to do: https://github.com/icarus-sim/icarus/blob/master/icarus/models/strategy/onpath.py#L275-L336


Good luck with your research,

Lorenzo





________________________________
From: Igor Carvalho <igfuca_at_gmail.com>
Sent: 23 January 2017 19:07:15
To: Saino, Lorenzo
Cc: icarus_at_ee.ucl.ac.uk
Subject: Re: [Icarus] Get the number of cache hits of nodes

Hi, Lorenzo.

Actually, I need to get the node with the highest cache hit in the request path (path[receiver:serving_node]) during the simulation. Once content is found in any cache node or the source in path, I'd like to retrieve the node with the highest cache hit so that the requested content be cached on in on the way back. Could you give me any suggestion?

regards,

On Mon, Jan 23, 2017 at 4:00 PM, Saino, Lorenzo <l.saino_at_alumni.ucl.ac.uk<mailto:l.saino_at_alumni.ucl.ac.uk>> wrote:

Hi Igor,


If you run experiments and you use the CacheHitRatioCollector (which you can do by adding the "CACHE_HIT_RATIO" entry to the list of collectors in your config file) with its default configuration, in the result set you will have, in addition to the overall cache hit ratio, a dictionary with the hit ratio of each cache node, i.e. a dictionary mapping node id to its cache hit ratio. You don't have to write any additional code for that.


Is that what you're looking for?


Lorenzo

________________________________
From: icarus-bounces_at_ee.ucl.ac.uk<mailto:icarus-bounces_at_ee.ucl.ac.uk> <icarus-bounces_at_ee.ucl.ac.uk<mailto:icarus-bounces_at_ee.ucl.ac.uk>> on behalf of Igor Carvalho <igfuca_at_gmail.com<mailto:igfuca_at_gmail.com>>
Sent: 23 January 2017 13:52:28
To: icarus_at_ee.ucl.ac.uk<mailto:icarus_at_ee.ucl.ac.uk>
Subject: [Icarus] Get the number of cache hits of nodes

Hi,

I'd like to get the number of cache hits of the path from the receiver to source. I know that I need to include collectors.py for that. To do so, I intend to use a dictionary so that it stores the nodes of the path and the number of cache hits. But the problem is that the class CacheHitRatioCollectors takes as parameters (off_path_hit, per_node, content_hit) and I don't know how to an object of this class stores in a dictionary the nodes and their cache hits. I really appreciate any help.

Regards,

--
Igor Carvalho
Master on Computer Science - UFPA
GERCOM Researcher.
--
Igor Carvalho
Master on Computer Science - UFPA
GERCOM Researcher.
Received on Mon Jan 23 2017 - 22:21:05 GMT

This archive was generated by hypermail 2.3.0 : Mon Jan 23 2017 - 22:21:07 GMT