Class MonitoringUtils


  • public final class MonitoringUtils
    extends java.lang.Object
    Monitoring helper class that contains utility methods used in Monitoring.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static double CACHEABLE_REQUEST_RATE_LIMIT
      Request rate limit (per second) below which statistics can be considered as cacheable.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MonitoringUtils()
      Prevent instantiation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.StringBuilder appendPath​(Resource resource, java.lang.StringBuilder path)  
      private static java.lang.String createPath​(Resource resource)  
      static java.lang.String getMethodUniqueId​(ResourceMethod method)
      Get the method unique string ID.
      (package private) static boolean isCacheable​(ExecutionStatistics stats)
      Indicates whether the global, resource, resource method statistics containing the give execution statistics can be cached.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CACHEABLE_REQUEST_RATE_LIMIT

        private static final double CACHEABLE_REQUEST_RATE_LIMIT
        Request rate limit (per second) below which statistics can be considered as cacheable.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MonitoringUtils

        private MonitoringUtils()
        Prevent instantiation.
    • Method Detail

      • getMethodUniqueId

        public static java.lang.String getMethodUniqueId​(ResourceMethod method)
        Get the method unique string ID. The ID is constructed from method attributes separated by pipe '|'. The attributes are used in the following order: method-produces|method-consumes|http-method|method-path|method-java-name

        If any of the attributes is not defined, "null" is used for such an attribute.

        Parameters:
        method - Resource method.
        Returns:
        String constructed from resource method parameters.
      • createPath

        private static java.lang.String createPath​(Resource resource)
      • appendPath

        private static java.lang.StringBuilder appendPath​(Resource resource,
                                                          java.lang.StringBuilder path)
      • isCacheable

        static boolean isCacheable​(ExecutionStatistics stats)
        Indicates whether the global, resource, resource method statistics containing the give execution statistics can be cached.
        Parameters:
        stats - execution statistics to be examined.
        Returns:
        true if the statistics can be cached, false otherwise.