Detailed Description
The ShareUsageTracker is used by the ShareUsageElement to determine whether to put evidence into a bundle to be sent to the 51Degrees Share Usage service.
Inheritance diagram for ShareUsageTracker:
Collaboration diagram for ShareUsageTracker:
Public Member Functions | |
| constructor ({ size=1000, interval=1200000 }={}) | |
| Constructor for ShareUsageTracker. | |
| match (key, value) | |
| Function to check if we should put the evidence in the cache. | |
| get (cacheKey) | |
| Retreive entry from cache. | |
| put (cacheKey) | |
| Put entry in cache. | |
Public Member Functions inherited from Tracker | |
| track (key) | |
| The track method calls the dataKeyedCache get method, if it receives a result it sends it onto a match function. | |
| match (key, value) | |
| If object is found in cache, the match function is called. | |
Public Member Functions inherited from DataKeyedCache | |
| get (cachekey) | |
| Get data out of the cache. | |
| put (cachekey, value) | |
| Add an element to the cache. | |
Member Function Documentation
◆ constructor()
|
inline |
Constructor for ShareUsageTracker.
- Parameters
-
{object} options options for share usage tracker {number} options.size size of the share usage lru cache {number} options.interval if identical evidence values are seen by the tracker within this interval (in milliseconds) it will be ignored by the tracker.
◆ get()
|
inline |
Retreive entry from cache.
- Parameters
-
{object} cacheKey key value store of evidence to lookup
- Returns
- {*} value stored in cache
◆ match()
|
inline |
Function to check if we should put the evidence in the cache.
- Parameters
-
{string} key key of piece of evidence {*} value value of piece of evidence
- Returns
- {boolean} whether put in cache
◆ put()
|
inline |
Put entry in cache.
- Parameters
-
{object} cacheKey key value store of evidence to place in cache
