\r\n

51Degrees Pipeline Python  4.4

51Degrees Pipeline for Python

fiftyone_pipeline_engines_fiftyone.share_usage_tracker.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 fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker:

[legend]

Collaboration diagram for fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker:

[legend]

Public Member Functions

def  __init__ (self, size=100, interval=1000)
Constructor for ShareUsageTracker @type size: int. More...
def  match (self, key, value)
The track method calls the dataKeyedCache get method, if it receives a result it sends it onto a match function. More...
def  get_cache_value (self, cachekey)
Get data from the cache @type key : string. More...
def  set_cache_value (self, cachekey, value=None)
Place data in the cache @type key : string. More...

Public Member Functions inherited from fiftyone_pipeline_engines.tracker.Tracker

def  track (self, key)
The track method calls the DataKeyedCache get method, if it receives a result it sends it onto a match function. More...
def  match (self, result)
If object is found in cache, the match function is called. More...

Public Attributes

 cache

Constructor & Destructor Documentation

◆ __init__()

def fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.__init__ (   self,
  size = 100,
  interval = 1000  
)

Constructor for ShareUsageTracker @type size: int.

Parameters
size - size of the share usage lru cache @type interval: int
interval - how often to put evidence into the cache

Member Function Documentation

◆ get_cache_value()

def fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.get_cache_value (   self,
  cachekey  
)

Get data from the cache @type key : string.

Parameters
key - : The cache key to lookup @type value : mixed
key - : None , or the stored data

Reimplemented from fiftyone_pipeline_engines.datakeyed_cache.DataKeyedCache.

◆ match()

def fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.match (   self,
  key,
  value  
)

The track method calls the dataKeyedCache get method, if it receives a result it sends it onto a match function.

@type key : cache key to run through tracker @rtype bool

Returns
result of tracking

◆ set_cache_value()

def fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.set_cache_value (   self,
  cachekey,
  value = None  
)

Place data in the cache @type key : string.

Parameters
key - : The cache key to store data under @type value : mixed
key - : Not used here as value is set to the date

Reimplemented from fiftyone_pipeline_engines.datakeyed_cache.DataKeyedCache.

Member Data Documentation

◆ cache

fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.cache

◆ interval

fiftyone_pipeline_engines_fiftyone.share_usage_tracker.ShareUsageTracker.interval