Class BaseMemoryMetricsDatastore<SUPPLIER,MSG extends QueueMessage>
- java.lang.Object
-
- com.slack.api.rate_limits.metrics.impl.BaseMemoryMetricsDatastore<SUPPLIER,MSG>
-
- All Implemented Interfaces:
MetricsDatastore,AutoCloseable
- Direct Known Subclasses:
MemoryMetricsDatastore,MemoryMetricsDatastore,MemoryMetricsDatastore
public abstract class BaseMemoryMetricsDatastore<SUPPLIER,MSG extends QueueMessage> extends Object implements MetricsDatastore, AutoCloseable
-
-
Field Summary
-
Fields inherited from interface com.slack.api.rate_limits.metrics.MetricsDatastore
DEFAULT_SINGLETON_EXECUTOR_NAME
-
-
Constructor Summary
Constructors Constructor Description BaseMemoryMetricsDatastore(int numberOfNodes)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.slack.api.rate_limits.metrics.MetricsDatastore
getStats
-
-
-
-
Method Detail
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getMetricsType
protected abstract String getMetricsType()
-
getThreadGroupName
public String getThreadGroupName()
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceMetricsDatastore
-
getAllStats
public Map<String,Map<String,RequestStats>> getAllStats()
- Specified by:
getAllStatsin interfaceMetricsDatastore
-
getStats
public RequestStats getStats(String executorName, String teamId)
- Specified by:
getStatsin interfaceMetricsDatastore
-
incrementAllCompletedCalls
public void incrementAllCompletedCalls(String executorName, String teamId, String methodName)
- Specified by:
incrementAllCompletedCallsin interfaceMetricsDatastore
-
incrementSuccessfulCalls
public void incrementSuccessfulCalls(String executorName, String teamId, String methodName)
- Specified by:
incrementSuccessfulCallsin interfaceMetricsDatastore
-
incrementUnsuccessfulCalls
public void incrementUnsuccessfulCalls(String executorName, String teamId, String methodName)
- Specified by:
incrementUnsuccessfulCallsin interfaceMetricsDatastore
-
incrementFailedCalls
public void incrementFailedCalls(String executorName, String teamId, String methodName)
- Specified by:
incrementFailedCallsin interfaceMetricsDatastore
-
getRateLimitQueue
public abstract RateLimitQueue<SUPPLIER,MSG> getRateLimitQueue(String executorName, String teamId)
-
updateCurrentQueueSize
public void updateCurrentQueueSize(String executorName, String teamId, String methodName)
- Specified by:
updateCurrentQueueSizein interfaceMetricsDatastore
-
setCurrentQueueSize
public void setCurrentQueueSize(String executorName, String teamId, String methodName, Integer size)
- Specified by:
setCurrentQueueSizein interfaceMetricsDatastore
-
getNumberOfLastMinuteRequests
public Integer getNumberOfLastMinuteRequests(String executorName, String teamId, String methodName)
- Specified by:
getNumberOfLastMinuteRequestsin interfaceMetricsDatastore
-
updateNumberOfLastMinuteRequests
public void updateNumberOfLastMinuteRequests(String executorName, String teamId, String methodName)
- Specified by:
updateNumberOfLastMinuteRequestsin interfaceMetricsDatastore
-
setNumberOfLastMinuteRequests
public void setNumberOfLastMinuteRequests(String executorName, String teamId, String methodName, Integer value)
- Specified by:
setNumberOfLastMinuteRequestsin interfaceMetricsDatastore
-
getRateLimitedMethodRetryEpochMillis
public Long getRateLimitedMethodRetryEpochMillis(String executorName, String teamId, String methodName)
- Specified by:
getRateLimitedMethodRetryEpochMillisin interfaceMetricsDatastore
-
setRateLimitedMethodRetryEpochMillis
public void setRateLimitedMethodRetryEpochMillis(String executorName, String teamId, String methodName, Long epochTimeMillis)
- Specified by:
setRateLimitedMethodRetryEpochMillisin interfaceMetricsDatastore
-
addToLastMinuteRequests
public void addToLastMinuteRequests(String executorName, String teamId, String methodName, Long currentMillis)
- Specified by:
addToLastMinuteRequestsin interfaceMetricsDatastore
-
getLastMinuteRequests
public LastMinuteRequests getLastMinuteRequests(String executorName, String teamId, String methodName)
- Specified by:
getLastMinuteRequestsin interfaceMetricsDatastore
-
addToWaitingMessageIds
public void addToWaitingMessageIds(String executorName, String teamId, String methodName, String messageId)
- Specified by:
addToWaitingMessageIdsin interfaceMetricsDatastore
-
deleteFromWaitingMessageIds
public void deleteFromWaitingMessageIds(String executorName, String teamId, String methodName, String messageId)
- Specified by:
deleteFromWaitingMessageIdsin interfaceMetricsDatastore
-
-