Class Metrics


  • public class Metrics
    extends java.lang.Object
    Extracts all attributes and methods annotated with ManagedAttribute and returns them as a map of names associated with [getter-method/description tuples]. E.g. for an attribute called foo, a method foo() or getFoo() is searched for.
    Since:
    5.4, 5.3.6
    Author:
    Bela Ban
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Metrics.Entry<T>  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected JChannel ch  
      static java.util.function.Predicate<java.lang.reflect.AccessibleObject> IS_NUMBER  
    • Constructor Summary

      Constructors 
      Constructor Description
      Metrics()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Number>>> convert​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> m)  
      static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Number>> convertProtocol​(java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> m)  
      static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> extract​(JChannel ch)  
      static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> extract​(JChannel ch, java.util.function.Predicate<java.lang.reflect.AccessibleObject> filter)  
      static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> extract​(Protocol p)  
      static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> extract​(Protocol p, java.util.function.Predicate<java.lang.reflect.AccessibleObject> filter)  
      protected static boolean isNumberAndScalar​(java.lang.reflect.AccessibleObject obj, java.lang.Class<?> cl)  
      protected static boolean isScalar​(java.lang.reflect.AccessibleObject obj)  
      static void main​(java.lang.String[] args)  
      protected static <T> void print​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<T>>> map)  
      protected void start​(boolean numeric)  
      • Methods inherited from class java.lang.Object

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

      • IS_NUMBER

        public static final java.util.function.Predicate<java.lang.reflect.AccessibleObject> IS_NUMBER
    • Constructor Detail

      • Metrics

        public Metrics()
    • Method Detail

      • extract

        public static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> extract​(JChannel ch)
      • extract

        public static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> extract​(JChannel ch,
                                                                                                                                          java.util.function.Predicate<java.lang.reflect.AccessibleObject> filter)
      • extract

        public static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> extract​(Protocol p)
      • extract

        public static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> extract​(Protocol p,
                                                                                                    java.util.function.Predicate<java.lang.reflect.AccessibleObject> filter)
      • start

        protected void start​(boolean numeric)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • print

        protected static <T> void print​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<T>>> map)
      • convert

        public static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Number>>> convert​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>>> m)
      • convertProtocol

        public static java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Number>> convertProtocol​(java.util.Map<java.lang.String,​Metrics.Entry<java.lang.Object>> m)
      • isNumberAndScalar

        protected static boolean isNumberAndScalar​(java.lang.reflect.AccessibleObject obj,
                                                   java.lang.Class<?> cl)
      • isScalar

        protected static boolean isScalar​(java.lang.reflect.AccessibleObject obj)
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Throwable
        Throws:
        java.lang.Throwable