public class FileSystemMetricSet
extends java.lang.Object
implements com.codahale.metrics.MetricSet
A set of gauges for basic properties of file systems visible to the JVM.
For each FS, gauges for the following properties are reported:
total_bytes - total number of bytesused_bytes - number of bytes usedused_pc - percentage usedfree_bytes - number of bytes freefree_pc - percentage free
Note that filesystem names are highly implementation-specific. Override
getFSName(FileStore) with an implementation that works on your
platform, for example getFSNameByToStringPath(FileStore)
| Constructor and Description |
|---|
FileSystemMetricSet()
Get metrics about default filesystems as returned by
FileSystems.getDefault(), skipping those with no usable space. |
FileSystemMetricSet(java.nio.file.FileSystem fs,
boolean skipZeroAvail) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFSNameByName(java.nio.file.FileStore store)
FileStore names are highly implementation specific.
|
java.util.Map<java.lang.String,com.codahale.metrics.Metric> |
getMetrics() |
public FileSystemMetricSet()
FileSystems.getDefault(), skipping those with no usable space.public FileSystemMetricSet(java.nio.file.FileSystem fs,
boolean skipZeroAvail)
fs - the Filesystem to useskipZeroAvail - Flag about whether or not to include FileStores that
show no usable spacepublic java.util.Map<java.lang.String,com.codahale.metrics.Metric> getMetrics()
getMetrics in interface com.codahale.metrics.MetricSetpublic java.lang.String getFSNameByName(java.nio.file.FileStore store)
store - the FileStore to get name ofFileStore.name()