[IC] Add filter on files for the CACHE_DIRECTORY_SIZE metric
Without the filter, we were walking both through subdirectories and their files, so some files might be counted twice. Moreover, the behaviour of `File.length` is unspecified for directories. ^KT-63010 In Progress
This commit is contained in:
committed by
Space Team
parent
4eccbd75c3
commit
06c1bcdc5d
+3
-1
@@ -421,7 +421,9 @@ abstract class IncrementalCompilerRunner<
|
|||||||
GradleBuildPerformanceMetric.SNAPSHOT_SIZE,
|
GradleBuildPerformanceMetric.SNAPSHOT_SIZE,
|
||||||
(buildHistoryFile?.length() ?: 0) + lastBuildInfoFile.length() + abiSnapshotFile.length()
|
(buildHistoryFile?.length() ?: 0) + lastBuildInfoFile.length() + abiSnapshotFile.length()
|
||||||
)
|
)
|
||||||
reporter.addMetric(GradleBuildPerformanceMetric.CACHE_DIRECTORY_SIZE, cacheDirectory.walk().sumOf { it.length() })
|
reporter.addMetric(
|
||||||
|
GradleBuildPerformanceMetric.CACHE_DIRECTORY_SIZE,
|
||||||
|
cacheDirectory.walk().filter { it.isFile }.sumOf { it.length() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user