Class MethodSummary

  • All Implemented Interfaces:
    java.lang.Comparable<MethodSummary>

    public class MethodSummary
    extends java.lang.Object
    implements java.lang.Comparable<MethodSummary>
    Tracked method summary (for all calls of exact method).
    Since:
    12.02.2025
    • Constructor Detail

      • MethodSummary

        public MethodSummary​(java.lang.Class<?> service,
                             java.lang.reflect.Method method,
                             com.codahale.metrics.Timer timer)
        Create summary.
        Parameters:
        service - service type
        method - method
        timer - method metrics
    • Method Detail

      • add

        public void add​(MethodTrack track)
        Used during summary object aggregation.
        Parameters:
        track - track to append to summary
      • getService

        public java.lang.Class<?> getService()
        Returns:
        method bean class
      • getMethod

        public java.lang.reflect.Method getMethod()
        Returns:
        method itself
      • getTracks

        public int getTracks()
        Returns:
        registered tracks count
      • getErrors

        public int getErrors()
        Returns:
        failed calls count
      • getMetrics

        public com.codahale.metrics.Snapshot getMetrics()
        Returns:
        metrics timer snapshot (for reporting)
      • getMin

        public java.lang.String getMin()
        Returns:
        minimal method call duration (string representation)
      • getMax

        public java.lang.String getMax()
        Returns:
        maximum method call duration (string representation)
      • getMedian

        public java.lang.String getMedian()
        Returns:
        median method call duration (string representation)
      • get75thPercentile

        public java.lang.String get75thPercentile()
        In test, the first execution would be slow (jvm warm up). This percentile should show more or less correct (hot) method execution time, in case of many executions (useful for "raw performance" checks).
        Returns:
        duration of 75% method calls (string representation)
      • get95thPercentile

        public java.lang.String get95thPercentile()
        Returns:
        duration of 95% method calls (string representation)
      • getInstancesCount

        public int getInstancesCount()
        Returns:
        number of different bean instances used for method calls
      • toStringMethod

        public java.lang.String toStringMethod()
        Method used for console reporting. Return type is not included because the method could be identified by arguments only.
        Returns:
        string representation for method (with argument types, but without return type)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(MethodSummary o)
        Specified by:
        compareTo in interface java.lang.Comparable<MethodSummary>