Class ResourceTracker
java.lang.Object
ecmwf.common.technical.ResourceTracker
Utility to track resource usage: open, closed, and peak concurrent count.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceTracker(Class<?> clazz) Instantiates a new resource tracker.ResourceTracker(Class<?> clazz, int debugFrequency) Instantiates a new resource tracker. -
Method Summary
-
Constructor Details
-
ResourceTracker
Instantiates a new resource tracker.- Parameters:
clazz- the clazz
-
ResourceTracker
Instantiates a new resource tracker.- Parameters:
clazz- the clazzdebugFrequency- the debug frequency
-
-
Method Details
-
onOpen
public void onOpen()Call this when a resource is opened. -
onClose
public void onClose(boolean success) Call this when a resource is closed.- Parameters:
success- the success
-
getOpenCount
public long getOpenCount()Gets the open count.- Returns:
- the open count
-
getClosedCount
public long getClosedCount()Gets the closed count.- Returns:
- the closed count
-
getErrorCount
public long getErrorCount()Gets the error count.- Returns:
- the error count
-
getPeakOpenCount
public long getPeakOpenCount()Gets the peak open count.- Returns:
- the peak open count
-
toString
-