Package com.martiansoftware.nailgun
Class NailStats
- java.lang.Object
-
- com.martiansoftware.nailgun.NailStats
-
- All Implemented Interfaces:
java.lang.Cloneable
public class NailStats extends java.lang.Object implements java.lang.CloneableCollects and provides statistics on a nail.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectlockprivate java.lang.Classnailclassprivate longrefCounterprivate longrunCounter
-
Constructor Summary
Constructors Constructor Description NailStats(java.lang.Class nailclass)Creates a new NailStats object for the specified class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates a copy of thisNailStatsobject.booleanequals(java.lang.Object o)Returns true iff the specifiedNailStatsobject is tracking the same class.java.lang.ClassgetNailClass()Returns the class for which we're tracking statisticslonggetRefCount()Returns the number of sessions currently running this nail.longgetRunCount()Returns the number of times this nail has been run.inthashCode()(package private) voidnailFinished()Logs the fact that an instance of this nail has finished(package private) voidnailStarted()Logs the fact that an instance of this nail has startedjava.lang.StringtoString()Returns a String representation of thisNailStatsobject, in the form "classname: runcount/refcount".
-
-
-
Method Detail
-
nailStarted
void nailStarted()
Logs the fact that an instance of this nail has started
-
nailFinished
void nailFinished()
Logs the fact that an instance of this nail has finished
-
getRunCount
public long getRunCount()
Returns the number of times this nail has been run. Nails that have started but not yet finished are included in this number.- Returns:
- the number of times this nail has been run.
-
getRefCount
public long getRefCount()
Returns the number of sessions currently running this nail.- Returns:
- the number of sessions currently running this nail.
-
getNailClass
public java.lang.Class getNailClass()
Returns the class for which we're tracking statistics- Returns:
- the class for which we're tracking statistics
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object o)
Returns true iff the specifiedNailStatsobject is tracking the same class.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the NailStats object to check- Returns:
- true iff the specified
NailStatsobject is tracking the same class.
-
clone
public java.lang.Object clone()
Creates a copy of thisNailStatsobject.- Overrides:
clonein classjava.lang.Object- Returns:
- a copy of this
NailStatsobject.
-
toString
public java.lang.String toString()
Returns a String representation of thisNailStatsobject, in the form "classname: runcount/refcount". *return a String representation of thisNailStatsobject.- Overrides:
toStringin classjava.lang.Object
-
-