Package com.cloudbees.simplediskusage
Class UsageComputation
- java.lang.Object
-
- com.cloudbees.simplediskusage.UsageComputation
-
public class UsageComputation extends Object
Compute disk usage of a list of paths. Results are published using listeners registered for interesting paths, so we only walk the disk once. The walker process is throttled to prevent IO starvation for other Jenkins tasks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
UsageComputation.CompletionListener
-
Constructor Summary
Constructors Constructor Description UsageComputation(List<Path> pathsToScan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(Path path, UsageComputation.CompletionListener listener)
void
compute()
void
computeFS()
protected void
computeUsage(Path path)
int
getItemsCount()
protected long
jenkinsFSUsage()
-
-
-
Method Detail
-
addListener
public void addListener(Path path, UsageComputation.CompletionListener listener)
-
getItemsCount
public int getItemsCount()
-
compute
public void compute() throws IOException
- Throws:
IOException
-
computeFS
public void computeFS()
-
jenkinsFSUsage
protected long jenkinsFSUsage()
-
computeUsage
protected void computeUsage(Path path) throws IOException
- Throws:
IOException
-
-