Interface BRSStatMXBean
- All Known Subinterfaces:
BRSOverloadProtectionMXBean
public interface BRSStatMXBean
Interface exposes and allows to set ECE Client statistical and tuning parameters
Following parameters are available over JMX and can be updated in a running system:
- Thread Pool Size - BRS uses a local thread pool to submit requests for processing and handle responses.
- Batch Time Out - Maximum time in milliseconds before the batch is considered ripe to be dispatched
- Batch Size - Maximum number of requests in a given batch before it is considered ripe to be dispatched
System Health parameter is exposed over JMX to expose the current health of the Cluster
- HEALTHY - The Cluster has minimum number of members available for processing to achieve required throughput
- DEGRADED - The Cluster has lost nodes and is not is under degraded mode.
Throughput calculation formula: small batch processing time - time to process a single 'small batch' (average) batchSize - size of a single 'small batch' threadPoolSize - thread pool size
1000 [ms] / small batch processing time [ms] * batchSize = threadThruput [request/sec/thread]
Example: 1000 / 30 * 18 = 600 [request/sec/thread]
threadThruput [request/sec/thread] * threadPoolSize [thread] = batchRequestServiceThruput [request/sec]
Example: = 120000 [request/sec]
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the current regular priority Batch Sizelong
Returns the regular priority Batch Timeout in millisecondsboolean
int
Returns the current high priority batch size.long
Returns the High Priority Batch Timeout in milliseconds.int
Method used to get the current size of the ThreadPool for the high priority ExecutorService used within the BatchRequestService.getMonitoringStats
(long startTime, int duration) returns the latency statistics for Client-to-Client round trip processing.int
Gets the reporting window size in seconds.int
Gets the current timeout value in seconds.getStats
(long startTime, int duration) returns the latency statistics for Client-to-Client round trip processing.Return the cluster health, maintained by BRS by tracking the nodes joining / leaving the clusterint
Method used to get the current size of the ThreadPool for the regular priority ExecutorService used within the BatchRequestService.long
Gets the thresholdLatencyvoid
init
(long start, long end) Initialize the service with a range of customers.boolean
Method to check is the current ECS cluster is healthy or notboolean
sendDiagnosticCode
(String code) Passes a diagnostic code to the BRS, output is sent to the BRS log file.void
setBatchSize
(int batchSize) Sets the size of how many requests should be bundled together before being sent for processing.void
setBatchTimeOut
(long millis) The time out in milliseconds at which the BRS sends the batch of requests for processing if the batch is not already filled Must be greater than or equal to the high priority Batch Timeout.void
setEnableNetworkExpiration
(boolean enable) Enables or disables network expiration.void
setHighPriorityBatchSize
(int batchSize) Sets the size of how many high priority requests should be bundled together before being sent for processing.void
setHighPriorityBatchTimeOut
(long millis) The time out in milliseconds at which the BRS sends the batch of requests for processing if the high priority batch is not already filled Must be lesser than or equal to the regular priority Batch Timeout.void
setHighPriorityThreadPoolSize
(int size) Method used to modify the ThreadPool size of the high priority ExecutorService used within the BatchRequestService.int
setReportingWindowSize
(int seconds) Sets the reporting window size in secondsvoid
setResponseTimeout
(int timeout) Sets the timeout threshold, in seconds, indicating how long the BRS will wait for an ECE Node to respond to a Request submission.void
setThreadPoolSize
(int size) Method used to modify the ThreadPool size of the regular priority ExecutorService used within the BatchRequestService.long
setThresholdLatency
(long thresholdLatency) Sets the thresholdLatency
-
Method Details
-
setResponseTimeout
void setResponseTimeout(int timeout) Sets the timeout threshold, in seconds, indicating how long the BRS will wait for an ECE Node to respond to a Request submission. If ECE is re-balancing grid nodes, then it's possible there may be a delay in processing the request. Occasionally there may be a transport error during a node re-balance. In this case, the BRS will retry the request submission numerous times within the timeout boundary in seconds, before finally returning a failure response to the caller. The failure response is returned to the caller through a CombinedResponseConsumer callback. Operators should implement the "public void failure(ResponseConsumerFailureCode reason, Listrequests)" callback method if they prefer to implement custom logic pertaining to timed-out requests. - Parameters:
timeout
- the timeout value in seconds. When the timeout value is exceeded, the BRS will return a failure response through the CombinedResponseConsumer callback. Any supplied value which is less-than 0 seconds will be ignored and have no effect on the current timeout value. (default out-of_box setting is 1 second).
-
getResponseTimeout
int getResponseTimeout()Gets the current timeout value in seconds. This pertains to Usage, Query, Policy and Management Requests and how long the BRS is willing to wait for the ECE server to respond with a response. When the Timeout condition is met, the BRS will invoke a failure response through the ResponseConsumerFailureCode callback. The out-of-box default value for a timeout is 1 second.- Returns:
- the current timeout value in seconds
-
setEnableNetworkExpiration
void setEnableNetworkExpiration(boolean enable) Enables or disables network expiration.- Parameters:
enable
- true to enable network expiration, false to disable it
-
getEnableNetworkExpiration
boolean getEnableNetworkExpiration() -
setThreadPoolSize
void setThreadPoolSize(int size) Method used to modify the ThreadPool size of the regular priority ExecutorService used within the BatchRequestService.- Parameters:
size
- of the thread pool.
-
getThreadPoolSize
int getThreadPoolSize()Method used to get the current size of the ThreadPool for the regular priority ExecutorService used within the BatchRequestService.- Returns:
- the current thread pool size
-
setBatchTimeOut
void setBatchTimeOut(long millis) The time out in milliseconds at which the BRS sends the batch of requests for processing if the batch is not already filled Must be greater than or equal to the high priority Batch Timeout.- Parameters:
millis
- Batch timeout in milliseconds
-
getBatchTimeOut
long getBatchTimeOut()Returns the regular priority Batch Timeout in milliseconds- Returns:
- int
-
setBatchSize
void setBatchSize(int batchSize) Sets the size of how many requests should be bundled together before being sent for processing. Though a bigger number could increase the throughput till the network bandwidth is exhausted, a low number like '1' will achieve lower latencies at the cost of throughput. Must be greater than or equal to the high priority Batch Size.- Parameters:
batchSize
- int
-
getBatchSize
int getBatchSize()Returns the current regular priority Batch Size- Returns:
- int
-
setHighPriorityThreadPoolSize
void setHighPriorityThreadPoolSize(int size) Method used to modify the ThreadPool size of the high priority ExecutorService used within the BatchRequestService. Setting a negative value disables the High Priority Queue. When enabled, INITIATE,CANCEL,DEBIT_UNIT,DEBIT_AMOUNT,BALANCE_QUERY,USER_DATA_REQUEST and AUTHENTICATION_QUERY requests are prioritized.- Parameters:
size
- of the thread pool.
-
getHighPriorityThreadPoolSize
int getHighPriorityThreadPoolSize()Method used to get the current size of the ThreadPool for the high priority ExecutorService used within the BatchRequestService.- Returns:
- the current thread pool size
-
setHighPriorityBatchTimeOut
void setHighPriorityBatchTimeOut(long millis) The time out in milliseconds at which the BRS sends the batch of requests for processing if the high priority batch is not already filled Must be lesser than or equal to the regular priority Batch Timeout.- Parameters:
millis
- Batch timeout in milliseconds
-
getHighPriorityBatchTimeOut
long getHighPriorityBatchTimeOut()Returns the High Priority Batch Timeout in milliseconds.- Returns:
- long
-
setHighPriorityBatchSize
void setHighPriorityBatchSize(int batchSize) Sets the size of how many high priority requests should be bundled together before being sent for processing. Though a bigger number could increase the throughput till the network bandwidth is exhausted, a low number like '1' will achieve lower latencies at the cost of throughput. Must be lesser than or equal to the regular priority Batch Size.- Parameters:
batchSize
- int
-
getHighPriorityBatchSize
int getHighPriorityBatchSize()Returns the current high priority batch size.- Returns:
- int
-
getSystemHealth
String getSystemHealth()Return the cluster health, maintained by BRS by tracking the nodes joining / leaving the cluster- Returns:
- the cluster health level
-
sendDiagnosticCode
Passes a diagnostic code to the BRS, output is sent to the BRS log file.- Parameters:
code
- the dianostic code (ex, "-BRS::AvailTimeSpreads").- Returns:
- false if the supplied code is not valid and cannot be processed by the BRS.
-
setReportingWindowSize
int setReportingWindowSize(int seconds) Sets the reporting window size in seconds- Parameters:
seconds
- int- Returns:
- The previous reporting window size
-
getReportingWindowSize
int getReportingWindowSize()Gets the reporting window size in seconds.- Returns:
- The current reporting window size
-
setThresholdLatency
long setThresholdLatency(long thresholdLatency) Sets the thresholdLatency- Parameters:
thresholdLatency
- in milli seconds long- Returns:
- The previous reporting window size
-
getThresholdLatency
long getThresholdLatency()Gets the thresholdLatency- Returns:
- The current thresholdLatency
-
init
void init(long start, long end) Initialize the service with a range of customers.- Parameters:
start
- starting customer idend
- ending customer id
-
getStats
returns the latency statistics for Client-to-Client round trip processing.- Parameters:
startTime
- the commencement time for gathering stats. Can be 0 to indicate the now time.duration
- the number of seconds worth of data to return, starting from the supplied startTime.- Returns:
- a Map of all the latency statistics for the requested time.
-
getMonitoringStats
returns the latency statistics for Client-to-Client round trip processing.- Parameters:
startTime
- the commencement time for gathering stats. Can be 0 to indicate the now time.duration
- the number of seconds worth of data to return, starting from the supplied startTime.- Returns:
- a Map of all the latency statistics for the requested time.
-
isSystemHealthy
boolean isSystemHealthy()Method to check is the current ECS cluster is healthy or not- Returns:
- true - Healthy / false - Not Healthy
-