Class MethodSummary
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.test.track.stat.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 Summary
Constructors Constructor Description MethodSummary(java.lang.Class<?> service, java.lang.reflect.Method method, com.codahale.metrics.Timer timer)Create summary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(MethodTrack track)Used during summary object aggregation.intcompareTo(MethodSummary o)java.lang.Stringget75thPercentile()In test, the first execution would be slow (jvm warm up).java.lang.Stringget95thPercentile()intgetErrors()intgetInstancesCount()java.lang.StringgetMax()java.lang.StringgetMedian()java.lang.reflect.MethodgetMethod()com.codahale.metrics.SnapshotgetMetrics()java.lang.StringgetMin()java.lang.Class<?>getService()intgetTracks()java.lang.StringtoString()java.lang.StringtoStringMethod()Method used for console reporting.
-
-
-
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:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(MethodSummary o)
- Specified by:
compareToin interfacejava.lang.Comparable<MethodSummary>
-
-