cachebox.system.cache.util

Class CacheStats

lucee.Component
    extended by cachebox.system.cache.util.CacheStats
All Implemented Interfaces:
IStats

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This is a cache statistics object. We do not use internal method calls but leverage the properties directly so it is faster.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any<ICacheProvider> cacheProvider
          The associated cache manager/provider of type: cachebox.

    • access = public
    • returntype = any
    • doc_generic = cachebox.system.cache.providers.ICacheProvider
    true false
    any evictionCount
          Eviction counts.

    • access = public
    • returntype = any
    0 true false
    any garbageCollections
          Garbage collection counts.

    • access = public
    • returntype = any
    0 true false
    any hits
          Cache hits.

    • access = public
    • returntype = any
    0 true false
    any lastReapDateTime
          Recording of last reap.

    • access = public
    • returntype = any
    true false
    any misses
          Cache misses.

    • access = public
    • returntype = any
    0 true false
    Constructor Summary
    init(any<ICacheProvider> cacheProvider)
          Constructor.
    Method Summary
    CacheStats GCHit()
         Record an garbage collection hit.
    any clearStatistics()
         Clear the stats.
    CacheStats evictionHit()
         Record an eviction hit.
    any getAssociatedCache()
         Get the associated cache provider/manager of type: cachebox.
    numeric getCachePerformanceRatio()
         Get the cache's performance ratio.
    string getCacheProvider()
    numeric getEvictionCount()
         Get the total cache's eviction count.
    numeric getGarbageCollections()
         Get the total cache's garbage collections.
    numeric getHits()
         Get the total cache's hits.
    any getLastReapDatetime()
         Get the date/time of the last reap the cache did.
    struct getMemento()
         A quick snapshot of the stats state.
    numeric getMisses()
         Get the total cache's misses.
    numeric getObjectCount()
         Get the associated cache's live object count.
    CacheStats hit()
         Record an cache hit.
    CacheStats miss()
         Record an cache miss.
    any setCacheProvider(any cacheProvider)
    any setEvictionCount(any evictionCount)
    any setGarbageCollections(any garbageCollections)
    any setHits(any hits)
    any setLastReapDateTime(any lastReapDateTime)
    any setMisses(any misses)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any<ICacheProvider> cacheProvider)

    Constructor

    Parameters:
    cacheProvider - The associated cache manager/provider of type: cachebox.system.cache.providers.ICacheProvider

    Property Detail

    cacheProvider

    property any<ICacheProvider> cacheProvider

    The associated cache manager/provider of type: cachebox.system.cache.providers.ICacheProvider

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - cachebox.system.cache.providers.ICacheProvider
    serializable - true

    evictionCount

    property any evictionCount = [0]

    Eviction counts

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    garbageCollections

    property any garbageCollections = [0]

    Garbage collection counts

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    hits

    property any hits = [0]

    Cache hits

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    lastReapDateTime

    property any lastReapDateTime

    Recording of last reap

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    misses

    property any misses = [0]

    Cache misses

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    GCHit

    public CacheStats GCHit()

    Record an garbage collection hit


    clearStatistics

    public any clearStatistics()

    Clear the stats

    Specified by:
    clearStatistics in interface IStats
    Returns:
    IStats

    evictionHit

    public CacheStats evictionHit()

    Record an eviction hit


    getAssociatedCache

    public any getAssociatedCache()

    Get the associated cache provider/manager of type: cachebox.system.cache.providers.ICacheProvider

    Returns:
    cachebox.system.cache.providers.ICacheProvider

    getCachePerformanceRatio

    public numeric getCachePerformanceRatio()

    Get the cache's performance ratio

    Specified by:
    getCachePerformanceRatio in interface IStats

    getCacheProvider

    public string getCacheProvider()


    getEvictionCount

    public numeric getEvictionCount()

    Get the total cache's eviction count

    Specified by:
    getEvictionCount in interface IStats

    getGarbageCollections

    public numeric getGarbageCollections()

    Get the total cache's garbage collections

    Specified by:
    getGarbageCollections in interface IStats

    getHits

    public numeric getHits()

    Get the total cache's hits

    Specified by:
    getHits in interface IStats

    getLastReapDatetime

    public any getLastReapDatetime()

    Get the date/time of the last reap the cache did

    Specified by:
    getLastReapDatetime in interface IStats
    Returns:
    date/time or empty

    getMemento

    public struct getMemento()

    A quick snapshot of the stats state


    getMisses

    public numeric getMisses()

    Get the total cache's misses

    Specified by:
    getMisses in interface IStats

    getObjectCount

    public numeric getObjectCount()

    Get the associated cache's live object count

    Specified by:
    getObjectCount in interface IStats

    hit

    public CacheStats hit()

    Record an cache hit


    miss

    public CacheStats miss()

    Record an cache miss


    setCacheProvider

    public any setCacheProvider(any cacheProvider)

    Parameters:
    cacheProvider

    setEvictionCount

    public any setEvictionCount(any evictionCount)

    Parameters:
    evictionCount

    setGarbageCollections

    public any setGarbageCollections(any garbageCollections)

    Parameters:
    garbageCollections

    setHits

    public any setHits(any hits)

    Parameters:
    hits

    setLastReapDateTime

    public any setLastReapDateTime(any lastReapDateTime)

    Parameters:
    lastReapDateTime

    setMisses

    public any setMisses(any misses)

    Parameters:
    misses