de.is24.util.monitoring.status
Class ServiceState

java.lang.Object
  extended by de.is24.util.monitoring.status.ServiceState

public class ServiceState
extends Object

this class implements a service state from observing two counters and calculating a failure rate for different time windows. Current windows are 1min, 5min, 15min. Therefor it samples the counters every 10 seconds.


Field Summary
private  Counter errorCounter
           
private  String errorCounterKey
           
private static org.apache.log4j.Logger LOGGER
           
private  String name
           
private  long previousErrorCounterValue
           
private  long previousSuccessCounterValue
           
private  SampledData sampledData
           
private  Counter successCounter
           
private  String successCounterKey
           
 
Constructor Summary
ServiceState(String name, String successCounterKey, String errorCounterKey)
           
 
Method Summary
 void check()
           
 void checkForReportable(Reportable reportable)
           
 String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.apache.log4j.Logger LOGGER

name

private final String name

successCounterKey

private final String successCounterKey

errorCounterKey

private final String errorCounterKey

previousSuccessCounterValue

private long previousSuccessCounterValue

previousErrorCounterValue

private long previousErrorCounterValue

successCounter

private Counter successCounter

errorCounter

private Counter errorCounter

sampledData

private SampledData sampledData
Constructor Detail

ServiceState

public ServiceState(String name,
                    String successCounterKey,
                    String errorCounterKey)
Method Detail

check

public void check()

checkForReportable

public void checkForReportable(Reportable reportable)

getName

public String getName()


Copyright © 2013 Immobilien Scout GmbH. All Rights Reserved.