com.netflix.astyanax.connectionpool.impl
Class SmaLatencyScoreStrategyInstanceImpl

java.lang.Object
  extended by com.netflix.astyanax.connectionpool.impl.SmaLatencyScoreStrategyInstanceImpl
All Implemented Interfaces:
LatencyScoreStrategy.Instance

public class SmaLatencyScoreStrategyInstanceImpl
extends Object
implements LatencyScoreStrategy.Instance


Constructor Summary
SmaLatencyScoreStrategyInstanceImpl(ConnectionPoolConfiguration config)
           
 
Method Summary
 void addSample(long sample, long now)
          Add a single latency sample
protected  double calculateCurrentScore(long now)
           
 long getLastSampleTime()
          Time of last sample added by calling addSample
 double getMean()
          Get the mean for the sample window
 double getScore()
          Get the cached score for this endpoint
 void reset()
          Reset the score and any internal stats
 void update(long now)
          Update the score for the current time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmaLatencyScoreStrategyInstanceImpl

public SmaLatencyScoreStrategyInstanceImpl(ConnectionPoolConfiguration config)
Method Detail

addSample

public void addSample(long sample,
                      long now)
Description copied from interface: LatencyScoreStrategy.Instance
Add a single latency sample

Specified by:
addSample in interface LatencyScoreStrategy.Instance

getScore

public double getScore()
Description copied from interface: LatencyScoreStrategy.Instance
Get the cached score for this endpoint

Specified by:
getScore in interface LatencyScoreStrategy.Instance
Returns:

reset

public void reset()
Description copied from interface: LatencyScoreStrategy.Instance
Reset the score and any internal stats

Specified by:
reset in interface LatencyScoreStrategy.Instance

update

public void update(long now)
Description copied from interface: LatencyScoreStrategy.Instance
Update the score for the current time

Specified by:
update in interface LatencyScoreStrategy.Instance

getLastSampleTime

public long getLastSampleTime()
Description copied from interface: LatencyScoreStrategy.Instance
Time of last sample added by calling addSample

Specified by:
getLastSampleTime in interface LatencyScoreStrategy.Instance
Returns:

calculateCurrentScore

protected double calculateCurrentScore(long now)

getMean

public double getMean()
Description copied from interface: LatencyScoreStrategy.Instance
Get the mean for the sample window

Specified by:
getMean in interface LatencyScoreStrategy.Instance
Returns:


Copyright © 2012. All Rights Reserved.