diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index e500a9a39b4098bc6ade3a82d4d980d0ad2616bb..55352f4b3017339b564cf24e8d49e125a4d4fd42 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -19604,7 +19604,7 @@ Returns [`[CiRunnerCloudProvisioningStep!]`](#cirunnercloudprovisioningstep). ### `CiRunnerUsage` -Runner usage. +Runner usage in minutes. #### Fields @@ -19623,8 +19623,9 @@ Runner usage in minutes by project. | Name | Type | Description | | ---- | ---- | ----------- | -| <a id="cirunnerusagebyprojectcibuildcount"></a>`ciBuildCount` | [`BigInt!`](#bigint) | Amount of builds executed during the selected period, encoded as a string. | -| <a id="cirunnerusagebyprojectciminutesused"></a>`ciMinutesUsed` | [`BigInt!`](#bigint) | Amount of minutes used during the selected period, encoded as a string. | +| <a id="cirunnerusagebyprojectcibuildcount"></a>`ciBuildCount` | [`BigInt!`](#bigint) | Amount of builds executed during the selected period. Encoded as a string. | +| <a id="cirunnerusagebyprojectciduration"></a>`ciDuration` | [`BigInt!`](#bigint) | Number of minutes spent to process jobs during the selected period. Encoded as a string. | +| <a id="cirunnerusagebyprojectciminutesused"></a>`ciMinutesUsed` **{warning-solid}** | [`BigInt!`](#bigint) | **Deprecated** in GitLab 17.5. Use `ciDuration`. | | <a id="cirunnerusagebyprojectproject"></a>`project` | [`Project`](#project) | Project that the usage refers to. Null means "Other projects". | ### `CiSecureFileRegistry` diff --git a/ee/app/graphql/types/ci/runner_usage_by_project_type.rb b/ee/app/graphql/types/ci/runner_usage_by_project_type.rb index b8629a3047a7752f7af3390bfc9104c0e260e85c..569d1c839144b2a3ecead040ca11d631cebc524e 100644 --- a/ee/app/graphql/types/ci/runner_usage_by_project_type.rb +++ b/ee/app/graphql/types/ci/runner_usage_by_project_type.rb @@ -10,11 +10,18 @@ class RunnerUsageByProjectType < BaseObject field :project, ::Types::ProjectType, null: true, description: 'Project that the usage refers to. Null means "Other projects".' + field :ci_duration, GraphQL::Types::BigInt, + null: false, + description: 'Number of minutes spent to process jobs during the selected period. Encoded as a string.', + hash_key: :ci_minutes_used + + # TODO: Remove in 18.0. For more details read https://gitlab.com/gitlab-org/gitlab/-/issues/497364 field :ci_minutes_used, GraphQL::Types::BigInt, - null: false, description: 'Amount of minutes used during the selected period, encoded as a string.' + null: false, description: 'Amount of minutes used during the selected period. Encoded as a string.', + deprecated: { reason: 'Use `ciDuration`', milestone: '17.5' } field :ci_build_count, GraphQL::Types::BigInt, - null: false, description: 'Amount of builds executed during the selected period, encoded as a string.' + null: false, description: 'Amount of builds executed during the selected period. Encoded as a string.' def project return unless object[:project_id] diff --git a/ee/app/graphql/types/ci/runner_usage_type.rb b/ee/app/graphql/types/ci/runner_usage_type.rb index b240951cce07d11f54752675f51178b8d6daf424..ac76351ac629d3099d3f0cd25ecddfa20b1473c6 100644 --- a/ee/app/graphql/types/ci/runner_usage_type.rb +++ b/ee/app/graphql/types/ci/runner_usage_type.rb @@ -5,7 +5,7 @@ module Ci # rubocop: disable Graphql/AuthorizeTypes -- the read_runner_usage permission is already checked by the resolver class RunnerUsageType < BaseObject graphql_name 'CiRunnerUsage' - description 'Runner usage.' + description 'Runner usage in minutes.' field :runner, ::Types::Ci::RunnerType, null: true, description: 'Runner that the usage refers to. Null means "Other runners".'