Package hudson.node_monitors
Class DiskSpaceMonitorDescriptor.DiskSpace
- java.lang.Object
-
- hudson.slaves.OfflineCause
-
- hudson.node_monitors.MonitorOfflineCause
-
- hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- DiskSpaceMonitorDescriptor
@ExportedBean public static final class DiskSpaceMonitorDescriptor.DiskSpace extends MonitorOfflineCause implements Serializable
Value object that represents the disk space.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.slaves.OfflineCause
OfflineCause.ByCLI, OfflineCause.ChannelTermination, OfflineCause.IdleOfflineCause, OfflineCause.LaunchFailed, OfflineCause.SimpleOfflineCause, OfflineCause.UserCause
-
-
Field Summary
Fields Modifier and Type Field Description longsize-
Fields inherited from class hudson.slaves.OfflineCause
timestamp
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetFreeSize()StringgetGbLeft()Deprecated.Directly use the size field or to get a human-readable value with units useFunctions.humanReadableByteSize(long)StringgetPath()The path that was checkedlonggetThreshold()longgetTotalSize()Class<? extends AbstractDiskSpaceMonitor>getTrigger()Identify monitor implementation that put computer offline.longgetWarningThreshold()booleanisTriggered()booleanisWarning()static DiskSpaceMonitorDescriptor.DiskSpaceparse(String size)Parses a human readable size description like "1GB", "0.5m", "500KiB", etc.voidsetThreshold(long threshold)voidsetTotalSize(long totalSize)protected voidsetTrigger(Class<? extends AbstractDiskSpaceMonitor> trigger)Sets the trigger class which made the decisionvoidsetWarningThreshold(long warningThreshold)StringtoHtml()Returns the HTML representation of the space.StringtoString()-
Methods inherited from class hudson.slaves.OfflineCause
create, getTime, getTimestamp
-
-
-
-
Constructor Detail
-
DiskSpace
public DiskSpace(String path, long size)
- Parameters:
path- Specify the file path that was monitored.
-
-
Method Detail
-
setTotalSize
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void setTotalSize(long totalSize)
-
getTotalSize
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported public long getTotalSize()
-
getPath
@Exported public String getPath()
The path that was checked
-
getFreeSize
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public long getFreeSize()
-
getGbLeft
@Deprecated(since="2.434") public String getGbLeft()
Deprecated.Directly use the size field or to get a human-readable value with units useFunctions.humanReadableByteSize(long)Gets GB left.
-
toHtml
public String toHtml()
Returns the HTML representation of the space.
-
isTriggered
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isTriggered()
-
isWarning
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isWarning()
-
setTrigger
protected void setTrigger(Class<? extends AbstractDiskSpaceMonitor> trigger)
Sets the trigger class which made the decision
-
setThreshold
public void setThreshold(long threshold)
-
getThreshold
@Exported public long getThreshold()
-
setWarningThreshold
public void setWarningThreshold(long warningThreshold)
-
getWarningThreshold
@Exported public long getWarningThreshold()
-
getTrigger
public Class<? extends AbstractDiskSpaceMonitor> getTrigger()
Description copied from class:MonitorOfflineCauseIdentify monitor implementation that put computer offline.- Specified by:
getTriggerin classMonitorOfflineCause
-
parse
public static DiskSpaceMonitorDescriptor.DiskSpace parse(String size) throws ParseException
Parses a human readable size description like "1GB", "0.5m", "500KiB", etc. intoDiskSpaceMonitorDescriptor.DiskSpace- Throws:
ParseException- If failed to parse.
-
-