Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano authored and github-actions[bot] committed Dec 19, 2024
1 parent 408c096 commit ff21ded
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 25 deletions.
42 changes: 25 additions & 17 deletions system/cache/providers/BoxLangProvider.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,24 @@ component
*/
struct function getStoreMetadataKeyMap(){
return {
"cacheName", "cacheName",
"hits", "hits",
"timeout", "timeout",
"lastAccessTimeout", "lastAccessTimeout",
"created", "created",
"lastAccessed", "lastAccessed",
"metadata", "metadata",
"key", "key",
"isEternal", "isEternal"
"cacheName",
"cacheName",
"hits",
"hits",
"timeout",
"timeout",
"lastAccessTimeout",
"lastAccessTimeout",
"created",
"created",
"lastAccessed",
"lastAccessed",
"metadata",
"metadata",
"key",
"key",
"isEternal",
"isEternal"
};
}

Expand Down Expand Up @@ -209,14 +218,13 @@ component
any lastAccessTimeout = "0",
any extra = {}
){
return cache( getConfiguration().cacheName )
.getOrSet(
arguments.objectKey,
arguments.produce,
arguments.timeout,
arguments.lastAccessTimeout,
arguments.extra
);
return cache( getConfiguration().cacheName ).getOrSet(
arguments.objectKey,
arguments.produce,
arguments.timeout,
arguments.lastAccessTimeout,
arguments.extra
);
}

/**
Expand Down
40 changes: 32 additions & 8 deletions system/cache/providers/boxlang-lib/BoxLangStats.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ component implements="coldbox.system.cache.util.IStats" accessors="true" {
* Get the cache's performance ratio
*/
numeric function getCachePerformanceRatio(){
return getCacheProvider().getCache().getStats().hitRate();
return getCacheProvider()
.getCache()
.getStats()
.hitRate();
}

/**
Expand All @@ -50,28 +53,40 @@ component implements="coldbox.system.cache.util.IStats" accessors="true" {
* Get the total cache's garbage collections
*/
numeric function getGarbageCollections(){
return getCacheProvider().getCache().getStats().garbageCollections();
return getCacheProvider()
.getCache()
.getStats()
.garbageCollections();
}

/**
* Get the total cache's eviction count
*/
numeric function getEvictionCount(){
return getCacheProvider().getCache().getStats().evictionCount();
return getCacheProvider()
.getCache()
.getStats()
.evictionCount();
}

/**
* Get the total cache's hits
*/
numeric function getHits(){
return getCacheProvider().getCache().getStats().hits();
return getCacheProvider()
.getCache()
.getStats()
.hits();
}

/**
* Get the total cache's misses
*/
numeric function getMisses(){
return getCacheProvider().getCache().getStats().misses();
return getCacheProvider()
.getCache()
.getStats()
.misses();
}

/**
Expand All @@ -80,21 +95,30 @@ component implements="coldbox.system.cache.util.IStats" accessors="true" {
* @return date/time or empty
*/
function getLastReapDatetime(){
return getCacheProvider().getCache().getStats().lastReapDatetime();
return getCacheProvider()
.getCache()
.getStats()
.lastReapDatetime();
}

/**
* Get the total cache's reap count
*/
numeric function getReapCount(){
return getCacheProvider().getCache().getStats().reapCount();
return getCacheProvider()
.getCache()
.getStats()
.reapCount();
}

/**
* When the cache was started
*/
function getStarted(){
return getCacheProvider().getCache().getStats().started();
return getCacheProvider()
.getCache()
.getStats()
.started();
}

}

0 comments on commit ff21ded

Please sign in to comment.