\r\n

51Degrees Pipeline Node.js  4.4

51Degrees Pipeline for Node.js

ShareUsageTracker Class Reference

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:

[legend]

Collaboration diagram for ShareUsageTracker:

[legend]

Public Member Functions

 constructor ({ size=1000, interval=1200000 }={})
Constructor for ShareUsageTracker. More...
 match (key, value)
Function to check if we should put the evidence in the cache. More...
 get (cacheKey)
Retreive entry from cache. More...
 put (cacheKey)
Put entry in cache. More...

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. More...
 match (key, value)
If object is found in cache, the match function is called. More...

Public Member Functions inherited from DataKeyedCache

 get (cachekey)
Get data out of the cache. More...
 put (cachekey, value)
Add an element to the cache. More...

Member Function Documentation

◆ constructor()

ShareUsageTracker::constructor (   { size=1000, interval=1200000 } = {} )
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()

ShareUsageTracker::get (   cacheKey )
inline

Retreive entry from cache.

Parameters
{object} - cacheKey key value store of evidence to lookup
Returns
{*} value stored in cache

◆ match()

ShareUsageTracker::match (   key,
  value  
)
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()

ShareUsageTracker::put (   cacheKey )
inline

Put entry in cache.

Parameters
{object} - cacheKey key value store of evidence to place in cache