Interface PerformanceMonitorInstance
-
public interface PerformanceMonitorInstance
The Monitor interface represents one set of monitors on one single Intelligence Server. All API users which are doing monitoring of counters on an Intelligence Server will share the same Monitor object.The Monitor object is fully thread-safe, even under concurrent usage of the same object by two different threads. Note that this means that code which uses the Monitor object should be written defensively - most collections contained within the Monitor class' hierarchy can change at any point. The API guarantees that the Monitor object and all subclasses will always be in a consistent state, but it is possible for one thread to add or remove items from a collection that is being browsed by another thread.
It is recommended that if this object is being used by multiple threads, that the stopMonitoring method is not called by any callers. The Monitor object has functionality which will cause any unused counters to be cleaned up if they are not Also, note that because all threads share the same Monitor object, caution should be taken when stopping the monitoring of counters.- Since:
- MicroStrategy Web 7.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Categories
getAvailableCategories()
Returns the list of available categories for the server which the monitor is associated with.Categories
getMonitoredCategories()
Returns a Categories collection which only contains thoseCounter
objects which are currently being monitored.Categories
getMonitoredCategories(WebPerformanceMonitor monitor)
CounterData
getValue(java.lang.String categoryName, java.lang.String instanceName, java.lang.String counterName)
A shortcut method to return the most recent data set for the given category, instance, and counter.boolean
isActive()
Returns whether this thread is actively polling for data.boolean
isMonitored(Counter c)
This method returns whether the given counter is being monitored or not.void
setIsActive(boolean isActive)
Causes the thread to either become active or inactive, if the status passed in is different from the original status of the Monitor.void
startMonitoring(Counter c)
This method starts monitoring for the given counter, if it has not already been started.void
startMonitoring(WebPerformanceMonitor monitor)
This method starts monitoring for the counters passed in the given monitor, if it has not already been started.void
stopMonitoring(Counter c)
This method stops monitoring for the given counter, if it is currently being monitored.
-
-
-
Method Detail
-
startMonitoring
void startMonitoring(Counter c)
This method starts monitoring for the given counter, if it has not already been started.- Parameters:
c
- TheCounter
object to start monitoring for.
-
startMonitoring
void startMonitoring(WebPerformanceMonitor monitor)
This method starts monitoring for the counters passed in the given monitor, if it has not already been started.- Parameters:
monitor
- TheWebPerformanceMonitor
object to start monitoring for.
-
stopMonitoring
void stopMonitoring(Counter c)
This method stops monitoring for the given counter, if it is currently being monitored. In an environment with multiple threads running, it is recommended that this method is not called. Instead, the auto-cleanup functionality of the Monitor should be allowed to clean up unused counters.- Parameters:
c
- TheCounter
to stop monitoring for.
-
isMonitored
boolean isMonitored(Counter c)
This method returns whether the given counter is being monitored or not.- Parameters:
c
- TheCounter
to check monitoring status for.- Returns:
- True if the counter is being monitored, false otherwise.
-
getAvailableCategories
Categories getAvailableCategories()
Returns the list of available categories for the server which the monitor is associated with. This is a full list of the counters which can be monitored on this server.- Returns:
- A
Categories
collection containing the list of available categories.
-
getMonitoredCategories
Categories getMonitoredCategories()
Returns a Categories collection which only contains thoseCounter
objects which are currently being monitored. This collection will be a subset of the collection returned from getAvailableCategories.- Returns:
- A
Categories
collection containing only those counters which are being monitored.
-
getMonitoredCategories
Categories getMonitoredCategories(WebPerformanceMonitor monitor)
Returns a Categories collection from the (monitor object passed), which only contains thoseCategory
-Instance
-Counter
collection that are currently being monitored. This collection will be a subset of the collection returned from getAvailableCategories.- Parameters:
monitor
- TheWebPerformanceMonitor
object to look for.- Returns:
- A
Categories
collection containing only those counters which are being monitored.
-
getValue
CounterData getValue(java.lang.String categoryName, java.lang.String instanceName, java.lang.String counterName) throws java.lang.IllegalArgumentException
A shortcut method to return the most recent data set for the given category, instance, and counter. This is equivalent to finding the Counter in the collection returned from getMonitoredCategories and calling getValue on it.- Parameters:
categoryName
- The name of the category.instanceName
- The name of the instance.counterName
- The name of the counter.- Returns:
- A
CounterData
object containing the result of the most recent data collection. - Throws:
java.lang.IllegalArgumentException
- If the given category, instance, and counter are not found in the list of monitored counters.
-
isActive
boolean isActive()
Returns whether this thread is actively polling for data. If this is false, then the data for all monitored counters will never be updated. If this is true, then the data for all monitored counters will be updated at the configured refresh rate.- Returns:
- Whether the Monitor object is active or not.
-
setIsActive
void setIsActive(boolean isActive) throws java.lang.UnsupportedOperationException
Causes the thread to either become active or inactive, if the status passed in is different from the original status of the Monitor. Note that this Monitor must still be owned by the MonitorManager class in order to become activated; if the Monitor has timed out in the manager, then another monitor must be obtained from the manager and activated.- Parameters:
isActive
- If the monitor was active, and this is false, then the monitor will be deactivated, causing data collection to stop for all counters. If the monitor was inactive, and this parameter is true, then the monitor will be activated, starting data collection to begin. If this parameter is the same as the current status, nothing will happen.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the Monitor is no longer owned by the MonitorManager. This will occur if the Monitor times out because of inactivity.
-
-