Class ProfilerThread
- java.lang.Object
-
- org.noise_planet.noisemodelling.pathfinder.utils.profiler.ProfilerThread
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ProfilerThread.Metric
Metric is a collection of statistics to write on the profile csv file
-
Field Summary
Fields Modifier and Type Field Description org.slf4j.Logger
log
AtomicLong
timeTracker
-
Constructor Summary
Constructors Constructor Description ProfilerThread(File outputFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetric(ProfilerThread.Metric metric)
add this given metric (collection of statistics to write on the profile csv file)<T extends ProfilerThread.Metric>
TgetMetric(Class<T> metricClass)
void
run()
Runs the thread to continuously write metric data to the output file.Runs the thread to continuously write metric data to the output file.void
setFlushInterval(int flushInterval)
void
setWriteInterval(int writeInterval)
void
stop()
-
-
-
Field Detail
-
log
public org.slf4j.Logger log
-
timeTracker
public AtomicLong timeTracker
-
-
Constructor Detail
-
ProfilerThread
public ProfilerThread(File outputFile)
-
-
Method Detail
-
addMetric
public void addMetric(ProfilerThread.Metric metric)
add this given metric (collection of statistics to write on the profile csv file)- Parameters:
metric
-
-
setWriteInterval
public void setWriteInterval(int writeInterval)
- Parameters:
writeInterval
- In seconds, intervals for writing new metrics in the csv file
-
setFlushInterval
public void setFlushInterval(int flushInterval)
- Parameters:
flushInterval
- Time in seconds between each effective write on the hard drive
-
run
public void run()
Runs the thread to continuously write metric data to the output file.Runs the thread to continuously write metric data to the output file.
-
stop
public void stop()
-
getMetric
public <T extends ProfilerThread.Metric> T getMetric(Class<T> metricClass)
- Type Parameters:
T
-- Parameters:
metricClass
-- Returns:
-
-