---
title: "Get the build cache performance of a Gradle build."
method: GET
path: "/api/builds/{id}/gradle-build-cache-performance"
tags: ["Builds", "GradleEnterprise", "Develocity"]
---

# Get the build cache performance of a Gradle build.

`GET /api/builds/{id}/gradle-build-cache-performance`

## Request

- Base URL: `https://develocity.example.com`
- URL: `https://develocity.example.com/api/builds/{id}/gradle-build-cache-performance`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/develocity/apis/develocity-api/docs/api/builds/:id/gradle-build-cache-performance/get.ts> (a function with typed inputs; its response is checked against the schema)

This model is Gradle specific and cannot be requested for another build tool.

## Response `200`

The build cache performance of a Gradle build.

- GradleBuildCachePerformance: The build cache performance of a Gradle build.
  - `id` string, required: The Build Scan ID.
  - `buildTime` integer, required: Wall clock duration of the build in milliseconds.
  - `effectiveTaskExecutionTime` integer, required: Wall clock time spent executing tasks in milliseconds. It is the time spent between the start of the first task in the execution phase and the end of the last task of the execution phase, removing any interval where no task is being executed.
  - `effectiveWorkUnitExecutionTime` integer, required: Wall clock time spent executing work units (tasks and artifact transforms) in milliseconds. It is the time spent between the start of the first work unit in the execution phase and the end of the last work unit of the execution phase, removing any interval where no work unit is being executed.
  - `serialTaskExecutionTime` integer, required: Wall clock time of all task executions in milliseconds. It is the sum of all individual task durations.
  - `serialWorkUnitExecutionTime` integer, required: Wall clock time of all work unit executions (tasks and artifact transforms) in milliseconds. It is the sum of all individual work unit durations.
  - `serializationFactor` number, double, required: The ratio of `serialWorkUnitExecutionTime` over the `effectiveWorkUnitExecutionTime`. Quantifies the effect of work unit parallelization. A value equal to `1` means that no parallelization occurred. A value greater than `1` means that work units are executed faster due to parallelization.
  - `taskExecution` GradleBuildCachePerformanceTaskExecutionEntry[], required: A list of executed tasks with performance related information.
    - `taskPath` string, required: The full task path.
    - `taskType` string, required: The fully qualified class name of the task.
    - `avoidanceOutcome` 'avoided_up_to_date' | 'avoided_from_local_cache' | 'avoided_from_remote_cache' | 'executed_cacheable' | 'executed_not_cacheable' | 'executed_unknown_cacheability' | 'avoided_unknown_reason' | 'lifecycle' | 'no-source' | 'skipped', required: The avoidance outcome of this task with respect to performance: * `avoided_up_to_date` - Task whose execution is avoided due to build incrementalism * `avoided_from_local_cache` - Task whose execution is avoided due to reusing a local build cache entry * `avoided_from_remote_cache` - Task whose execution is avoided due to reusing a remote build cache entry * `avoided_unknown_reason` - Task which was avoided for an unknown reason * `executed_cacheable` - Task which is executed but is cacheable * `executed_not_cacheable` - Task which is executed but is not cacheable * `executed_unknown_cacheability` - Task which is executed and whose cacheability can not be determined * `lifecycle` - Lifecycle task * `no-source` - No-source task * `skipped` - Skipped task
    - `duration` integer, required: The task duration in milliseconds.
    - `fingerprintingDuration` integer, nullable: The task fingerprinting duration in milliseconds. This duration is part of the complete task execution duration. `null` if the task is not fingerprinted, or the information is not available.
    - `avoidanceSavings` integer, nullable: The task avoidance savings in milliseconds, which can be negative. Negative values indicate that it takes more time to reuse outputs than it did to create them originally. `null` if the information is not available.
    - `nonCacheabilityCategory` 'build_cache_not_enabled' | 'cache-if_condition_not_matched' | 'disabled_to_ensure_correctness' | 'do-not-cache-if_condition_matched' | 'multiple_outputs_declared' | 'no_outputs_declared' | 'non_cacheable_inputs' | 'non_cacheable_task_action' | 'non_cacheable_task_implementation' | 'non_cacheable_tree_output' | 'overlapping_outputs' | 'task_has_no_actions' | 'task_output_caching_not_enabled' | 'unknown', nullable: The category of the non-cacheability reason: * `build_cache_not_enabled` - Caching is not enabled for the build * `cache-if_condition_not_matched` - Caching is disabled for the task via `org.gradle.api.tasks.TaskOutputs#cacheIf` * `disabled_to_ensure_correctness` - The task failed validation. Available since Gradle 7.0 * `do-not-cache-if_condition_matched` - Caching is disabled for the task via `org.gradle.api.tasks.TaskOutputs#doNotCacheIf` * `multiple_outputs_declared` - The task declares multiple outputs * `no_outputs_declared` - The task has no outputs declared * `non_cacheable_inputs` - One of the task inputs is not cacheable, either because some type used as an input to the task is loaded via a custom classloader, or a Java lambda is used as an input. Available since Gradle 5.0 and before Gradle 7.5 * `non_cacheable_task_action` - One of the task actions is not cacheable, either because it is loaded via a custom classloader, or a Java lambda is used to implement it. Available since Gradle 5.0 and before Gradle 7.5 * `non_cacheable_task_implementation` - The task implementation is not cacheable, either because it is loaded via a custom classloader, or a Java lambda is used to implement it. Available since Gradle 5.0 and before Gradle 7.5 * `non_cacheable_tree_output` - The task has a `org.gradle.api.file.FileTree` or a `org.gradle.api.internal.file.collections.DirectoryFileTree` as an output. Available since Gradle 5.0 * `overlapping_outputs` - The tasks outputs overlaps with another task. As Gradle cannot safely determine which task each output file belongs to, it disables caching * `task_has_no_actions` - The task does not declare any actions * `task_output_caching_not_enabled` - Caching is not enabled for the task * `unknown` - Reason for disabled caching is not known `null` when the task is cacheable or if the information is not available.
    - `nonCacheabilityReason` string, nullable: The human-readable reason for a non-cacheable task. `null` when the task is cacheable or if the information is not available.
    - `skipReasonMessage` string, nullable: The detailed reason why the task is skipped. `null` if the task is not skipped or Gradle versions <7.6 are used.
    - `cacheArtifactSize` integer, nullable: The number of bytes of the produced or consumed cache artifact. For a task execution where the outputs are successfully stored to a local or remote cache, this is the size of the stored cache artifact. For a task execution where the outputs are successfully loaded from a local or remote cache, this is the size of the loaded cache artifact. `null` if the task is not cacheable, or if the attempt to store or load the artifact from cache does not succeed.
    - `cacheArtifactRejectedReason` 'artifact_size_too_large', nullable: The reason why the cache artifact is rejected: * `artifact_size_too_large` - The size of the artifact is larger than the remote build cache can accept. The value is `null` if the task is not cacheable, or if the attempt to store the artifact does not succeed.
    - `cacheKey` string, nullable: The build cache key. `null` if no build cache key was computed (e.g. when the task is skipped).
    - `hasFailed` boolean, required: True when the task failed, false otherwise.
  - `taskFingerprintingSummary` GradleBuildCachePerformanceTaskFingerprintingSummary, nullable: A summary of task fingerprinting. Fingerprinted tasks are part of the `taskExecution.avoidedTasks` or `taskExecution.executedTasks`, or `taskExecution.noSourceTasks` buckets. `null` if Gradle version is < `5.0` or Develocity Gradle plugin version is < `2.1`.
    - `count` integer, required: Count of fingerprinted tasks.
    - `serialDuration` integer, required: Sum of all fingerprinting times of fingerprinted tasks in milliseconds.
  - `workUnitFingerprintingSummary` GradleBuildCachePerformanceWorkUnitFingerprintingSummary, nullable: A summary of task and artifact transform fingerprinting. `null` if Gradle version is < `5.0` or Develocity Gradle plugin version is < `2.1`.
    - `count` integer, required: Count of fingerprinted work units.
    - `serialDuration` integer, required: Sum of all fingerprinting times of fingerprinted work units in milliseconds.
  - `avoidanceSavingsSummary` GradleBuildCachePerformanceAvoidanceSavingsSummary, required: **This is deprecated, use `taskAvoidanceSavingsSummary` instead.** A breakdown of avoidance savings.
    - `total` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused in milliseconds.
    - `ratio` number, double, required: The ratio of the total avoidance savings against the potential serial execution time (which is the actual serial execution time plus the total avoidance savings). Quantifies the effect of avoidance savings in this build. The bigger the ratio is, the more time is saved when running the build.
    - `upToDate` integer, required: The estimated reduction in serial execution time of the tasks due to build incrementalism in milliseconds.
    - `localBuildCache` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused from the local build cache in milliseconds.
    - `remoteBuildCache` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused from the remote build cache in milliseconds.
  - `taskAvoidanceSavingsSummary` GradleBuildCachePerformanceTaskAvoidanceSavingsSummary, required: A breakdown of avoidance savings for tasks.
    - `total` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused in milliseconds.
    - `ratio` number, double, required: The ratio of the total avoidance savings against the potential serial execution time (which is the actual serial execution time plus the total avoidance savings). Quantifies the effect of avoidance savings in this build. The bigger the ratio is, the more time is saved when running the build.
    - `upToDate` integer, required: The estimated reduction in serial execution time of the tasks due to build incrementalism in milliseconds.
    - `localBuildCache` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused from the local build cache in milliseconds.
    - `remoteBuildCache` integer, required: The estimated reduction in serial execution time of the tasks due to their outputs being reused from the remote build cache in milliseconds.
  - `workUnitAvoidanceSavingsSummary` GradleBuildCachePerformanceWorkUnitAvoidanceSavingsSummary, required: A breakdown of avoidance savings for tasks and artifact transforms.
    - `total` integer, required: The estimated reduction in serial execution time of the work units due to their outputs being reused in milliseconds.
    - `ratio` number, double, required: The ratio of the total avoidance savings against the potential serial execution time (which is the actual serial execution time plus the total avoidance savings). Quantifies the effect of avoidance savings in this build. The bigger the ratio is, the more time is saved when running the build.
    - `upToDate` integer, required: The estimated reduction in serial execution time of the work units due to build incrementalism in milliseconds.
    - `localBuildCache` integer, required: The estimated reduction in serial execution time of the work units due to their outputs being reused from the local build cache in milliseconds.
    - `remoteBuildCache` integer, required: The estimated reduction in serial execution time of the work units due to their outputs being reused from the remote build cache in milliseconds.
  - `buildCaches` GradleBuildCachePerformanceBuildCaches, nullable: Information about the local and remote build caches used in the build. `null` if the build cache is globally disabled.
    - `local` GradleBuildCachePerformanceBuildCacheLocalInfo, required: Information about the local build cache used in the build.
      - `isEnabled` boolean, required: Indicates whether the local build cache is enabled.
      - `isPushEnabled` boolean, nullable: Indicates whether pushing to the local build cache is enabled. `null` if the local build cache is disabled.
      - `isDisabledDueToError` boolean: Indicates whether the local cache is disabled due to an error occurring in loading or storing local build cache entries. `null` if the local build cache is disabled.
      - `directory` string, nullable: Location of the local build cache. Can be relative or absolute depending on its value. `null` if the local build cache is disabled.
    - `remote` GradleBuildCachePerformanceBuildCacheRemoteInfo, required: Information about the remote build cache used in the build.
      - `type` string, nullable: The type of the connector used to communicate with the remote build cache. `null` if the remote build cache is disabled.
      - `className` string, nullable: The class name of the connector. `null` if the remote build cache is disabled.
      - `isEnabled` boolean, required: Indicates whether the remote build cache is enabled.
      - `isPushEnabled` boolean, nullable: Indicates whether pushing to the remote build cache is enabled. `null` if the remote build cache is disabled.
      - `isDisabledDueToError` boolean: Indicates whether the remote build cache is disabled during the build due to an error occurring in loading or storing remote build cache entries. `null` if the remote build cache is disabled.
      - `url` string, nullable: URL of the remote build cache. `null` if the remote build cache is disabled or if the given type is not supported or it doesn't have the concept of a URL.
    - `overhead` GradleBuildCachePerformanceBuildCacheOverhead, required: Information about the build cache overhead in this build.
      - `uploading` integer, required: Overhead of upload operations in milliseconds.
      - `downloading` integer, required: Overhead of download operations in milliseconds.
      - `packing` integer, required: Overhead of pack operations in milliseconds.
      - `unpacking` integer, required: Overhead of unpack operations in milliseconds.

## Other responses

- `400`: The request cannot be fulfilled due to a problem.
- `404`: The referenced resource either does not exist or the permissions to know about it are missing.
- `500`: The server encountered an unexpected error.
- `503`: The server is not ready to handle the request.

---

[API](https://skmtc.dev/develocity/apis/develocity-api.md) - [All operations](https://skmtc.dev/develocity/apis/develocity-api/llms.txt) - [OpenAPI document](https://skmtc.dev/develocity/apis/develocity-api/revisions/b49835fbf065?raw)
