Class CompositeDiskUsageDataImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.statistics.diskusage.CompositeDiskUsageDataImpl
-
- All Implemented Interfaces:
CompositeDiskUsageData
,DiskUsageDataReader
public class CompositeDiskUsageDataImpl extends Object implements CompositeDiskUsageData
-
-
Constructor Summary
Constructors Constructor Description CompositeDiskUsageDataImpl(String entityId)
CompositeDiskUsageDataImpl(String storageId, DiskUsageData data)
CompositeDiskUsageDataImpl(Map<String,DiskUsageData> diskUsageData, String entityId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeDiskUsageData
add(CompositeDiskUsageData other, boolean mergePerBuildData)
Summarizes two composited disk usage data instancesCompositeDiskUsageData
add(DiskUsageData other, boolean mergePerBuildData, String storageId)
Adds disk usage data to the storage with a given idCompositeDiskUsageData
cleanEmptyStorages()
Cleans empty data, saved in this storageCompositeDiskUsageData
clone()
boolean
containsData()
boolean
equals(Object o)
long
getArtifactSize()
long[][]
getBuildsData()
long[][]
getBuildsWithHugeLogsIds()
long
getCleanedSize()
Optional<DiskUsageData>
getDiskUsageByStorageId(String storageId)
Map<String,DiskUsageData>
getDiskUsageData()
String
getEntityId()
Entity id of an entity, characterized by this data.long
getInternalArtifactsSize()
long
getLastUpdatedDate()
long
getLogSize()
long
getNonBuilds()
long
getVersion()
int
hashCode()
boolean
isUpdating()
CompositeDiskUsageData
subtract(CompositeDiskUsageData other)
Excludes data of the other instanceCompositeDiskUsageData
subtract(DiskUsageData other, String storageId)
Excludes disk usage data from the storage with a given id
-
-
-
Constructor Detail
-
CompositeDiskUsageDataImpl
public CompositeDiskUsageDataImpl(@NotNull Map<String,DiskUsageData> diskUsageData, @NotNull String entityId)
-
CompositeDiskUsageDataImpl
public CompositeDiskUsageDataImpl(@NotNull String entityId)
-
CompositeDiskUsageDataImpl
public CompositeDiskUsageDataImpl(@NotNull String storageId, @NotNull DiskUsageData data)
-
-
Method Detail
-
getDiskUsageByStorageId
@NotNull public Optional<DiskUsageData> getDiskUsageByStorageId(@NotNull String storageId)
- Specified by:
getDiskUsageByStorageId
in interfaceCompositeDiskUsageData
- Returns:
- DiskUsageData for a particular storage with given id
-
getDiskUsageData
@NotNull public Map<String,DiskUsageData> getDiskUsageData()
- Specified by:
getDiskUsageData
in interfaceCompositeDiskUsageData
- Returns:
- mapping from all storage ids, which info is stored in the instance, to the particular data
-
add
@NotNull public CompositeDiskUsageData add(@NotNull CompositeDiskUsageData other, boolean mergePerBuildData)
Description copied from interface:CompositeDiskUsageData
Summarizes two composited disk usage data instances- Specified by:
add
in interfaceCompositeDiskUsageData
mergePerBuildData
- true if information about saved builds should be merged as well- Returns:
- merged instance
-
getVersion
public long getVersion()
- Specified by:
getVersion
in interfaceDiskUsageDataReader
- Returns:
- version of this instance. Versions are used for proper disk usage auto-update
-
getLastUpdatedDate
public long getLastUpdatedDate()
- Specified by:
getLastUpdatedDate
in interfaceDiskUsageDataReader
- Returns:
- last update time
- See Also:
DiskUsageDataReader.isUpdating()
-
getArtifactSize
public long getArtifactSize()
- Specified by:
getArtifactSize
in interfaceDiskUsageDataReader
- Returns:
- artifacts size in bytes
-
getInternalArtifactsSize
public long getInternalArtifactsSize()
- Specified by:
getInternalArtifactsSize
in interfaceDiskUsageDataReader
- Returns:
- internal artifacts size in bytes
-
getLogSize
public long getLogSize()
- Specified by:
getLogSize
in interfaceDiskUsageDataReader
- Returns:
- logs size in bytes
-
getEntityId
@NotNull public String getEntityId()
Description copied from interface:DiskUsageDataReader
Entity id of an entity, characterized by this data. Basically it's a project or build type internal id- Specified by:
getEntityId
in interfaceDiskUsageDataReader
- Returns:
- id of a characterized entity
-
isUpdating
public boolean isUpdating()
- Specified by:
isUpdating
in interfaceDiskUsageDataReader
- Returns:
- true if this instance is updating now (e.g. its properties recalculated or a new build is being processed)
-
getCleanedSize
public long getCleanedSize()
- Specified by:
getCleanedSize
in interfaceDiskUsageDataReader
- Returns:
- size of files (including artifacts and logs) in bytes, which where removed by server cleanup
-
getNonBuilds
public long getNonBuilds()
- Specified by:
getNonBuilds
in interfaceDiskUsageDataReader
- Returns:
- size of files in bytes, which are not recognized as build artifacts or logs
-
clone
@NotNull public CompositeDiskUsageData clone()
- Specified by:
clone
in interfaceCompositeDiskUsageData
- Overrides:
clone
in classObject
- Returns:
- full clone of this instance
-
subtract
@NotNull public CompositeDiskUsageData subtract(@NotNull CompositeDiskUsageData other)
Description copied from interface:CompositeDiskUsageData
Excludes data of the other instance- Specified by:
subtract
in interfaceCompositeDiskUsageData
- Returns:
- resulted instance
-
add
@NotNull public CompositeDiskUsageData add(@NotNull DiskUsageData other, boolean mergePerBuildData, @NotNull String storageId)
Description copied from interface:CompositeDiskUsageData
Adds disk usage data to the storage with a given id- Specified by:
add
in interfaceCompositeDiskUsageData
- Parameters:
other
- data to addmergePerBuildData
- true if information about saved builds should be merged as wellstorageId
- target storage id- Returns:
- resulted instance
-
subtract
@NotNull public CompositeDiskUsageData subtract(@NotNull DiskUsageData other, @NotNull String storageId)
Description copied from interface:CompositeDiskUsageData
Excludes disk usage data from the storage with a given id- Specified by:
subtract
in interfaceCompositeDiskUsageData
- Parameters:
other
- data to excludestorageId
- target storage id- Returns:
- resulted instance
-
containsData
public boolean containsData()
- Specified by:
containsData
in interfaceCompositeDiskUsageData
- Returns:
- true if this instance contains any data
-
cleanEmptyStorages
@NotNull public CompositeDiskUsageData cleanEmptyStorages()
Description copied from interface:CompositeDiskUsageData
Cleans empty data, saved in this storage- Specified by:
cleanEmptyStorages
in interfaceCompositeDiskUsageData
- Returns:
- resulted instance
-
getBuildsWithHugeLogsIds
@Nullable public long[][] getBuildsWithHugeLogsIds()
- Specified by:
getBuildsWithHugeLogsIds
in interfaceDiskUsageDataReader
- Returns:
- fixed number of information about builds, which have atypically huge size of build logs. The list is sorted by build logs size descendally
- See Also:
HugeLogs
-
getBuildsData
@Nullable public long[][] getBuildsData()
- Specified by:
getBuildsData
in interfaceDiskUsageDataReader
- Returns:
- information about builds, contributing into disk usage of this entity. The list is sorted by total build artifacts size descendally. Not all builds are saved, but only a fixed number of top builds
-
-