public class LatencyView extends Object implements LatencyViewMBean
LatencyView provides statistical information related to the latency (overhead) incurred by the Synapse NHTTP transport, when mediating messages back and forth. Statistics are available under two main categories, namely short term data and long term data. Short term data is statistical information related to the last 15 minutes of execution and these metrics are updated every 5 seconds. Long term data is related to the last 24 hours of execution and they are updated every 5 minutes. Two timer tasks and a single threaded scheduled executor is used to perform these periodic calculations.
Latency calculation for a single invocation is carried out by taking timestamps on following events:
Having taken these timestamps, the latency for the invocation is calculated as follows:
Latency = (t4 - t1) - (t3 - t2)
Constructor and Description |
---|
LatencyView(String latencyMode,
String transportName) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
double |
getAllTimeAvgLatency() |
double |
getLast15MinuteAvgLatency() |
double |
getLast24HourAvgLatency() |
double |
getLast5MinuteAvgLatency() |
double |
getLast8HourAvgLatency() |
double |
getLastHourAvgLatency() |
double |
getLastMinuteAvgLatency() |
Date |
getLastResetTime() |
void |
notifyTimes(long reqArrival,
long reqDeparture,
long resArrival,
long resDeparture)
Report the timestamp values captured during mediating messages back and forth
|
void |
reset() |
public void destroy()
public void notifyTimes(long reqArrival, long reqDeparture, long resArrival, long resDeparture)
reqArrival
- The request arrival timereqDeparture
- The request departure time (backend connection establishment)resArrival
- The resoponse arrival timeresDeparture
- The response departure timepublic double getAllTimeAvgLatency()
getAllTimeAvgLatency
in interface LatencyViewMBean
public double getLastMinuteAvgLatency()
getLastMinuteAvgLatency
in interface LatencyViewMBean
public double getLast5MinuteAvgLatency()
getLast5MinuteAvgLatency
in interface LatencyViewMBean
public double getLast15MinuteAvgLatency()
getLast15MinuteAvgLatency
in interface LatencyViewMBean
public double getLastHourAvgLatency()
getLastHourAvgLatency
in interface LatencyViewMBean
public double getLast8HourAvgLatency()
getLast8HourAvgLatency
in interface LatencyViewMBean
public double getLast24HourAvgLatency()
getLast24HourAvgLatency
in interface LatencyViewMBean
public void reset()
reset
in interface LatencyViewMBean
public Date getLastResetTime()
getLastResetTime
in interface LatencyViewMBean
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.