Class MethodSummary

java.lang.Object
ru.vyarus.dropwizard.guice.test.track.stat.MethodSummary
All Implemented Interfaces:
Comparable<MethodSummary>

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

    • MethodSummary

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

    • add

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

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

      public 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 String getMin()
      Returns:
      minimal method call duration (string representation)
    • getMax

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

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

      public 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 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 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 String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(MethodSummary o)
      Specified by:
      compareTo in interface Comparable<MethodSummary>