ePages 7.23.0 - DE_EPAGES/WebInterface/API/ASPoolDBCacheServer.pm

Package DE_EPAGES::WebInterface::API::ASPoolDBCacheServer

This module provides methods for communication with the ASPoolDB cache server.

Functions

new
ping
requestCacheInfo
requestPreferenceInfo
resetCache
resetStatistics

new

Creates a new ASPoolDBCacheServer object.

Syntax
$CacheServer = DE_EPAGES::WebInterface::API::ASPoolDBCacheServer->new;
Example
my $CacheServer = DE_EPAGES::WebInterface::API::ASPoolDBCacheServer->new;
$CacheServer->resetCache;
Return
$CacheServer (DE_EPAGES::WebInterface::API::ASPoolDBCacheServer)
ASPoolDBCacheServer object

ping

Sends a ping request to the ASPoolDB Cache Server.

Syntax
$CacheServer->ping;
$CacheServer->ping($Payload);
Input
$Payload (string)
Data to send with the request, will be echoed by the server
(optional)
Return
$Response (string)
The payload that was echoed by the server

requestCacheInfo

Requests information about the cache utilization of ASPoolDBCacheServers

Syntax
$CacheServer->requestCacheInfo;
Return
$Response (ref.array.hash
  • host - The host name or IP address of the server
  • port - The port the server listens on
  • good - Cache statistics for valid requests
    • hits - Number of valid requests that were served from the cache
    • misses - Number of valid requests that couldn't be served from the cache
    • size - Current number of entries in the cache
    • gc - How often the cache was full and old entries were removed

  • bad - Cache statistics for invalid requests
    • hits - Number of invalid requests that were rejected from the cache
    • misses - Number of invalid requests that couldn't be rejected from the cache
    • size - Current number of entries in the cache
    • gc - How often the cache was full and old entries were removed
)
Array of cache info for each responding server

requestPreferenceInfo

Returns the address of the currently preferred RequestRouter for the given pool

Syntax
my $PreferredRR = $CacheServer->requestPreferenceInfo($PoolName);
Input
$PoolName (string)
name of the pool to request info for
Return
$Addresses (boolean)
addresses of the currently preferred RequestRouter, one
per active ASPoolDBCacheServer

resetCache

Sends a cache reset request to the ASPoolDB Cache Server.

Syntax
$CacheServer->resetCache;
$CacheServer->resetCache($SiteGUID);
Input
$SiteGUID (string)
GUID of the site to delete the cache for (optional, omit to
reset the entire cache)

resetStatistics

Resets cache statistics on all cache servers

Syntax
$CacheServer->resetStatistics;