Class ProfilerThread
- java.lang.Object
-
- org.noise_planet.noisemodelling.pathfinder.utils.profiler.ProfilerThread
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceProfilerThread.MetricMetric is a collection of statistics to write on the profile csv file
-
Field Summary
Fields Modifier and Type Field Description org.slf4j.LoggerlogAtomicLongtimeTracker
-
Constructor Summary
Constructors Constructor Description ProfilerThread(File outputFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetric(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)voidrun()Runs the thread to continuously write metric data to the output file.Runs the thread to continuously write metric data to the output file.voidsetFlushInterval(int flushInterval)voidsetWriteInterval(int writeInterval)voidstop()
-
-
-
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:
-
-