org.slf4j.profiler

Class Profiler

public class Profiler extends Object implements TimeInstrument

A poor man's profiler to measure the time elapsed performing some lengthy task.

Author: Ceki Gülcü

Constructor Summary
Profiler(String name)
Method Summary
longelapsedTime()
List<TimeInstrument>getCopyOfChildTimeInstruments()
Return a copy of the child instrument list for this Profiler instance.
StopWatchgetCopyOfGlobalStopWatch()
Return a copy of the global stopwath of this Profiler instance.
LoggergetLogger()
StringgetName()
ProfilerRegistrygetProfilerRegistry()
TimeInstrumentStatusgetStatus()
voidlog()
voidprint()
voidregisterWith(ProfilerRegistry profilerRegistry)
voidsetLogger(Logger logger)
voidstart(String name)
Starts a child stop watch and stops any previously started time instruments.
ProfilerstartNested(String name)
TimeInstrumentstop()

Constructor Detail

Profiler

public Profiler(String name)

Method Detail

elapsedTime

public long elapsedTime()

getCopyOfChildTimeInstruments

public List<TimeInstrument> getCopyOfChildTimeInstruments()
Return a copy of the child instrument list for this Profiler instance.

Returns: a copy of this instance's child time instrument list

Since: 1.5.9

getCopyOfGlobalStopWatch

public StopWatch getCopyOfGlobalStopWatch()
Return a copy of the global stopwath of this Profiler instance.

Returns: a copy of this instance's global stop watch

Since: 1.5.9

getLogger

public Logger getLogger()

getName

public String getName()

getProfilerRegistry

public ProfilerRegistry getProfilerRegistry()

getStatus

public TimeInstrumentStatus getStatus()

log

public void log()

print

public void print()

registerWith

public void registerWith(ProfilerRegistry profilerRegistry)

setLogger

public void setLogger(Logger logger)

start

public void start(String name)
Starts a child stop watch and stops any previously started time instruments.

startNested

public Profiler startNested(String name)

stop

public TimeInstrument stop()
Copyright © 2005-2010 QOS.ch. All Rights Reserved.