Interface DiskUsageData

    • 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 instance
        mergePerBuildData - 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 build
        size - 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 build
        size - size in bytes, which this build occupies
        maxCount - 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 build
        logSize - 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 builds
        maxCount - 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()