Interface DiskUsageData
-
- All Superinterfaces:
DiskUsageDataReader
- All Known Implementing Classes:
DiskUsageDataImpl
public interface DiskUsageData extends DiskUsageDataReader
Contains data about disk usage of a single project/build type on a single storage- Since:
- 2020.2
- See Also:
ArtifactStorageDiskUsageInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DiskUsageDataadd(DiskUsageData other, boolean mergePerBuildData)Create disk usage, which summarizes information about two instancesvoidaddBuildsData(long id, long size)Adds information about a buildvoidaddBuildsData(long id, long size, int maxCount)Adds information about a buildlong[][]addBuildsData(long buildId, long size, int maxCount, long[][] buildsData)Add a build to tracked.voidaddBuildWithHugeLog(long buildId, long logSize)Saves information, that this build has huge logDiskUsageDataclone()Creates another disk usage instance with the same propertiesvoiddecreaseBuildsNumber()Decreases number of builds, which disk usage is included into this instancevoiddecreaseCleanedBuildsNumber()Decreases number of builds, which were reported as cleaned in this instanceStringencode()Encodes DiskUsageData to a stringlonggetBuildsNumber()longgetCleanedBuildsNumber()voidincreaseArtifactsSize(long artifactsSize)Increases the artifacts sizevoidincreaseCleanedBuildsNumber()Increases number of builds without build artifactsvoidincreaseCleanedSize(long size)Increases size of files, which were cleanedvoidincreaseInternalArtifactsSize(long internalArtifactsSize)Increases the internal artifacts sizevoidincreaseLogsSize(long logSize)Increases the logs sizevoidincreaseNonBuildSize(long size)Increases size of files, which are not related to any buildbooleanisEmpty()voidremoveBuildData(long buildId)Removes information about a build, if it was savedvoidremoveBuildWithHugeLog(long buildId)Removes information about some build huge log, if it was savedvoidsetArtifactsSize(long size)Sets the artifacts sizevoidsetBuildsData(long[][] buildsData, int maxCount)Sets information about involved buildsvoidsetLastUpdatedDate(long lastUpdatedDate)Sets update datevoidsetLogSize(long size)Sets the logs sizevoidsetUpdating(boolean updating)Set or reset updating flagDiskUsageDatasubtract(DiskUsageData other)Create disk usage, which excludes data from another instance-
Methods inherited from interface jetbrains.buildServer.serverSide.statistics.diskusage.DiskUsageDataReader
getArtifactSize, getBuildsData, getBuildsWithHugeLogsIds, getCleanedSize, getEntityId, getInternalArtifactsSize, getLastUpdatedDate, getLogSize, getNonBuilds, getVersion, isUpdating
-
-
-
-
Method Detail
-
clone
@NotNull DiskUsageData clone()
Creates another disk usage instance with the same properties- Returns:
- this disk usage clone
-
add
@NotNull DiskUsageData add(@NotNull DiskUsageData other, boolean mergePerBuildData)
Create disk usage, which summarizes information about two instances- Parameters:
other- a disk usage instance, which is to be merged with this instancemergePerBuildData- true if the information about tracked builds should be merged as well- Returns:
- merged disk usage
-
subtract
@NotNull DiskUsageData subtract(@NotNull DiskUsageData other)
Create disk usage, which excludes data from another instance- Parameters:
other- a disk usage instance, which is to be excluded from this instance- Returns:
- resulted disk usage
-
increaseArtifactsSize
void increaseArtifactsSize(long artifactsSize)
Increases the artifacts size- Parameters:
artifactsSize- size to add in bytes
-
increaseInternalArtifactsSize
void increaseInternalArtifactsSize(long internalArtifactsSize)
Increases the internal artifacts size- Parameters:
internalArtifactsSize- size to add in bytes
-
increaseLogsSize
void increaseLogsSize(long logSize)
Increases the logs size- Parameters:
logSize- size to add in bytes
-
removeBuildData
void removeBuildData(long buildId)
Removes information about a build, if it was saved- Parameters:
buildId- build id of a corresponding build
-
addBuildsData
void addBuildsData(long id, long size)Adds information about a build- Parameters:
id- build id of a corresponding buildsize- size in bytes, which this build occupies
-
addBuildsData
void addBuildsData(long id, long size, int maxCount)Adds information about a build- Parameters:
id- build id of a corresponding buildsize- size in bytes, which this build occupiesmaxCount- number of builds, which information should be saved in this instance
-
addBuildsData
long[][] addBuildsData(long buildId, long size, int maxCount, @Nullable long[][] buildsData)Add a build to tracked. If builds total size is above average it will be stored in a storage (DiskUsageDataReader.getBuildsData()).- Parameters:
buildId-size-maxCount-buildsData-
-
removeBuildWithHugeLog
void removeBuildWithHugeLog(long buildId)
Removes information about some build huge log, if it was saved- Parameters:
buildId- build id of a corresponding build
-
addBuildWithHugeLog
void addBuildWithHugeLog(long buildId, long logSize)Saves information, that this build has huge log- Parameters:
buildId- build id of a corresponding buildlogSize- size of build log in bytes
-
decreaseBuildsNumber
void decreaseBuildsNumber()
Decreases number of builds, which disk usage is included into this instance
-
decreaseCleanedBuildsNumber
void decreaseCleanedBuildsNumber()
Decreases number of builds, which were reported as cleaned in this instance
-
increaseCleanedBuildsNumber
void increaseCleanedBuildsNumber()
Increases number of builds without build artifacts
-
increaseNonBuildSize
void increaseNonBuildSize(long size)
Increases size of files, which are not related to any build- Parameters:
size- non-build size in bytes
-
increaseCleanedSize
void increaseCleanedSize(long size)
Increases size of files, which were cleaned- Parameters:
size- cleaned size in bytes
-
encode
@NotNull String encode()
Encodes DiskUsageData to a string- Returns:
- encoded instance
-
setArtifactsSize
void setArtifactsSize(long size)
Sets the artifacts size- Parameters:
artifactsSize- size in bytes
-
setLogSize
void setLogSize(long size)
Sets the logs size- Parameters:
logSize- size in bytes
-
setBuildsData
void setBuildsData(long[][] buildsData, int maxCount)Sets information about involved builds- Parameters:
buildsData- information about buildsmaxCount- max number of builds to track
-
setUpdating
void setUpdating(boolean updating)
Set or reset updating flag- Parameters:
updating- true if this instance is updating now
-
setLastUpdatedDate
void setLastUpdatedDate(long lastUpdatedDate)
Sets update date- Parameters:
lastUpdatedDate-
-
getBuildsNumber
long getBuildsNumber()
- Returns:
- number of builds, accounted in this instance
-
getCleanedBuildsNumber
long getCleanedBuildsNumber()
- Returns:
- number of builds, cleaned in this instance
-
isEmpty
boolean isEmpty()
-
-