Package com.martiansoftware.nailgun
Class NailStats
java.lang.Object
com.martiansoftware.nailgun.NailStats
- All Implemented Interfaces:
Cloneable
Collects and provides statistics on a nail.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a copy of thisNailStats
object.boolean
Returns true iff the specifiedNailStats
object is tracking the same class.Returns the class for which we're tracking statisticslong
Returns the number of sessions currently running this nail.long
Returns the number of times this nail has been run.int
hashCode()
(package private) void
Logs the fact that an instance of this nail has finished(package private) void
Logs the fact that an instance of this nail has startedtoString()
Returns a String representation of thisNailStats
object, in the form "classname: runcount/refcount".
-
Field Details
-
nailclass
-
runCounter
private long runCounter -
refCounter
private long refCounter -
lock
-
-
Constructor Details
-
NailStats
NailStats(Class nailclass) Creates a new NailStats object for the specified class- Parameters:
nailclass
- the class for which we'll collect statistics
-
-
Method Details
-
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
Returns the class for which we're tracking statistics- Returns:
- the class for which we're tracking statistics
-
hashCode
public int hashCode() -
equals
Returns true iff the specifiedNailStats
object is tracking the same class. -
clone
Creates a copy of thisNailStats
object. -
toString
Returns a String representation of thisNailStats
object, in the form "classname: runcount/refcount". *return a String representation of thisNailStats
object.
-