com.netflix.loadbalancer
Class ServerStats

java.lang.Object
  extended by com.netflix.loadbalancer.ServerStats

public class ServerStats
extends java.lang.Object

Capture various stats per Server(node) in the LoadBalancer


Constructor Summary
ServerStats()
           
ServerStats(LoadBalancerStats lbStats)
           
 
Method Summary
 void addToFailureCount()
          Increment the count of failures for this Server
 void clearSuccessiveConnectionFailureCount()
           
 void decrementActiveRequestsCount()
           
 int getActiveRequestsCount()
           
 int getActiveRequestsCount(long currentTime)
           
 long getFailureCount()
          Returns the count of failures in the current window
 long getFailureCountSlidingWindowInterval()
           
 long getMeasuredRequestsCount()
           
 int getMonitoredActiveRequestsCount()
           
 double getResponseTime10thPercentile()
          Gets the 10-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime25thPercentile()
          Gets the 25-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime50thPercentile()
          Gets the 50-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime75thPercentile()
          Gets the 75-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime90thPercentile()
          Gets the 90-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime95thPercentile()
          Gets the 95-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime98thPercentile()
          Gets the 98-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime99point5thPercentile()
          Gets the 99.5-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTime99thPercentile()
          Gets the 99-th percentile in the total amount of time spent handling a request, in milliseconds.
 double getResponseTimeAvg()
          Gets the average total amount of time to handle a request, in milliseconds.
 double getResponseTimeAvgRecent()
          Gets the average total amount of time to handle a request in the recent time-slice, in milliseconds.
 double getResponseTimeMax()
          Gets the maximum amount of time spent handling a request, in milliseconds.
 double getResponseTimeMin()
          Gets the minimum amount of time spent handling a request, in milliseconds.
 int getResponseTimePercentileNumValues()
          Gets the number of samples used to compute the various response-time percentiles.
 java.lang.String getResponseTimePercentileTime()
          Gets the time when the varios percentile data was last updated.
 long getResponseTimePercentileTimeMillis()
          Gets the time when the varios percentile data was last updated, in milliseconds since the epoch.
 double getResponseTimeStdDev()
          Gets the standard deviation in the total amount of time spent handling a request, in milliseconds.
 int getSuccessiveConnectionFailureCount()
           
 long getTotalRequestsCount()
           
 void incrementActiveRequestsCount()
           
 void incrementNumRequests()
           
 void incrementSuccessiveConnectionFailureCount()
           
 void initialize(Server server)
          Initializes the object, starting data collection and reporting.
 boolean isCircuitBreakerTripped()
           
 boolean isCircuitBreakerTripped(long currentTime)
           
static void main(java.lang.String[] args)
           
 void noteResponseTime(double msecs)
          Call this method to note the response time after every request
 void setBufferSize(int bufferSize)
           
 void setFailureCountSlidingWindowInterval(long failureCountSlidingWindowInterval)
           
 void setPublishInterval(int publishInterval)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerStats

public ServerStats()

ServerStats

public ServerStats(LoadBalancerStats lbStats)
Method Detail

initialize

public void initialize(Server server)
Initializes the object, starting data collection and reporting.


setBufferSize

public void setBufferSize(int bufferSize)

setPublishInterval

public void setPublishInterval(int publishInterval)

getFailureCountSlidingWindowInterval

public long getFailureCountSlidingWindowInterval()

setFailureCountSlidingWindowInterval

public void setFailureCountSlidingWindowInterval(long failureCountSlidingWindowInterval)

addToFailureCount

public void addToFailureCount()
Increment the count of failures for this Server


getFailureCount

public long getFailureCount()
Returns the count of failures in the current window

Returns:

noteResponseTime

public void noteResponseTime(double msecs)
Call this method to note the response time after every request

Parameters:
msecs -

incrementNumRequests

public void incrementNumRequests()

incrementActiveRequestsCount

public void incrementActiveRequestsCount()

decrementActiveRequestsCount

public void decrementActiveRequestsCount()

getActiveRequestsCount

public int getActiveRequestsCount()

getActiveRequestsCount

public int getActiveRequestsCount(long currentTime)

getMeasuredRequestsCount

public long getMeasuredRequestsCount()

getMonitoredActiveRequestsCount

@Monitor(name="ActiveRequestsCount",
         type=GAUGE)
public int getMonitoredActiveRequestsCount()

isCircuitBreakerTripped

@Monitor(name="CircuitBreakerTripped",
         type=GAUGE)
public boolean isCircuitBreakerTripped()

isCircuitBreakerTripped

public boolean isCircuitBreakerTripped(long currentTime)

incrementSuccessiveConnectionFailureCount

public void incrementSuccessiveConnectionFailureCount()

clearSuccessiveConnectionFailureCount

public void clearSuccessiveConnectionFailureCount()

getSuccessiveConnectionFailureCount

@Monitor(name="SuccessiveConnectionFailureCount",
         type=GAUGE)
public int getSuccessiveConnectionFailureCount()

getResponseTimeAvg

@Monitor(name="OverallResponseTimeMillisAvg",
         type=INFORMATIONAL,
         description="Average total time for a request, in milliseconds")
public double getResponseTimeAvg()
Gets the average total amount of time to handle a request, in milliseconds.


getResponseTimeMax

@Monitor(name="OverallResponseTimeMillisMax",
         type=INFORMATIONAL,
         description="Max total time for a request, in milliseconds")
public double getResponseTimeMax()
Gets the maximum amount of time spent handling a request, in milliseconds.


getResponseTimeMin

@Monitor(name="OverallResponseTimeMillisMin",
         type=INFORMATIONAL,
         description="Min total time for a request, in milliseconds")
public double getResponseTimeMin()
Gets the minimum amount of time spent handling a request, in milliseconds.


getResponseTimeStdDev

@Monitor(name="OverallResponseTimeMillisStdDev",
         type=INFORMATIONAL,
         description="Standard Deviation in total time to handle a request, in milliseconds")
public double getResponseTimeStdDev()
Gets the standard deviation in the total amount of time spent handling a request, in milliseconds.


getResponseTimePercentileNumValues

@Monitor(name="ResponseTimePercentileNumValues",
         type=GAUGE,
         description="The number of data points used to compute the currently reported percentile values")
public int getResponseTimePercentileNumValues()
Gets the number of samples used to compute the various response-time percentiles.


getResponseTimePercentileTime

@Monitor(name="ResponseTimePercentileWhen",
         type=INFORMATIONAL,
         description="The time the percentile values were computed")
public java.lang.String getResponseTimePercentileTime()
Gets the time when the varios percentile data was last updated.


getResponseTimePercentileTimeMillis

@Monitor(name="ResponseTimePercentileWhenMillis",
         type=COUNTER,
         description="The time the percentile values were computed in milliseconds since the epoch")
public long getResponseTimePercentileTimeMillis()
Gets the time when the varios percentile data was last updated, in milliseconds since the epoch.


getResponseTimeAvgRecent

@Monitor(name="ResponseTimeMillisAvg",
         type=GAUGE,
         description="Average total time for a request in the recent time slice, in milliseconds")
public double getResponseTimeAvgRecent()
Gets the average total amount of time to handle a request in the recent time-slice, in milliseconds.


getResponseTime10thPercentile

@Monitor(name="ResponseTimeMillis10Percentile",
         type=INFORMATIONAL,
         description="10th percentile in total time to handle a request, in milliseconds")
public double getResponseTime10thPercentile()
Gets the 10-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime25thPercentile

@Monitor(name="ResponseTimeMillis25Percentile",
         type=INFORMATIONAL,
         description="25th percentile in total time to handle a request, in milliseconds")
public double getResponseTime25thPercentile()
Gets the 25-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime50thPercentile

@Monitor(name="ResponseTimeMillis50Percentile",
         type=INFORMATIONAL,
         description="50th percentile in total time to handle a request, in milliseconds")
public double getResponseTime50thPercentile()
Gets the 50-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime75thPercentile

@Monitor(name="ResponseTimeMillis75Percentile",
         type=INFORMATIONAL,
         description="75th percentile in total time to handle a request, in milliseconds")
public double getResponseTime75thPercentile()
Gets the 75-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime90thPercentile

@Monitor(name="ResponseTimeMillis90Percentile",
         type=INFORMATIONAL,
         description="90th percentile in total time to handle a request, in milliseconds")
public double getResponseTime90thPercentile()
Gets the 90-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime95thPercentile

@Monitor(name="ResponseTimeMillis95Percentile",
         type=GAUGE,
         description="95th percentile in total time to handle a request, in milliseconds")
public double getResponseTime95thPercentile()
Gets the 95-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime98thPercentile

@Monitor(name="ResponseTimeMillis98Percentile",
         type=INFORMATIONAL,
         description="98th percentile in total time to handle a request, in milliseconds")
public double getResponseTime98thPercentile()
Gets the 98-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime99thPercentile

@Monitor(name="ResponseTimeMillis99Percentile",
         type=GAUGE,
         description="99th percentile in total time to handle a request, in milliseconds")
public double getResponseTime99thPercentile()
Gets the 99-th percentile in the total amount of time spent handling a request, in milliseconds.


getResponseTime99point5thPercentile

@Monitor(name="ResponseTimeMillis99_5Percentile",
         type=GAUGE,
         description="99.5th percentile in total time to handle a request, in milliseconds")
public double getResponseTime99point5thPercentile()
Gets the 99.5-th percentile in the total amount of time spent handling a request, in milliseconds.


getTotalRequestsCount

public long getTotalRequestsCount()

toString

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

main

public static void main(java.lang.String[] args)