org.jenkinsci.plugins.uptime
Class DefaultUptimeService

java.lang.Object
  extended by org.jenkinsci.plugins.uptime.DefaultUptimeService
All Implemented Interfaces:
UptimeService

public class DefaultUptimeService
extends Object
implements UptimeService

Default implementation of the UptimeService

Author:
Chris Mair

Constructor Summary
DefaultUptimeService()
           
 
Method Summary
protected  long getTimeNow()
           
 BigDecimal getUptimePercentage(hudson.util.RunList<hudson.model.Run<?,?>> builds)
          Calculate the fraction of time that the job (represented by the set of Runs) has been successful over the total time since its first Run (build).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUptimeService

public DefaultUptimeService()
Method Detail

getUptimePercentage

public BigDecimal getUptimePercentage(hudson.util.RunList<hudson.model.Run<?,?>> builds)
Calculate the fraction of time that the job (represented by the set of Runs) has been successful over the total time since its first Run (build). The times are measured in a granularity of milliseconds.

Specified by:
getUptimePercentage in interface UptimeService
Parameters:
builds - - the RunList representing the build history of a project; must not be null, but may be empty
Returns:
a BigDecimal representing the percentage, with a scale of 3 (i.e., 0.000 to 1.000)

getTimeNow

protected long getTimeNow()


Copyright © 2004-2013. All Rights Reserved.