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 long
size
-
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 long
getFreeSize()
String
getGbLeft()
Deprecated.Directly use the size field or to get a human-readable value with units useFunctions.humanReadableByteSize(long)
String
getPath()
The path that was checkedlong
getThreshold()
long
getTotalSize()
Class<? extends AbstractDiskSpaceMonitor>
getTrigger()
Identify monitor implementation that put computer offline.long
getWarningThreshold()
boolean
isTriggered()
boolean
isWarning()
static DiskSpaceMonitorDescriptor.DiskSpace
parse(String size)
Parses a human readable size description like "1GB", "0.5m", "500KiB", etc.void
setThreshold(long threshold)
void
setTotalSize(long totalSize)
protected void
setTrigger(Class<? extends AbstractDiskSpaceMonitor> trigger)
Sets the trigger class which made the decisionvoid
setWarningThreshold(long warningThreshold)
String
toHtml()
Returns the HTML representation of the space.String
toString()
-
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:MonitorOfflineCause
Identify monitor implementation that put computer offline.- Specified by:
getTrigger
in 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.
-
-