## GetPrTimeSeries **post** `/gitpod.v1.UsageService/GetPrTimeSeries` Gets PR speed metrics as a time series. Use this method to: - Chart pull request lead time, review latency, and deploy counts - Select hourly, daily, weekly, or monthly buckets - Scope PR speed insights to a project, user, or team ### Example ```yaml dateRange: startTime: "2024-01-01T00:00:00Z" endTime: "2024-02-01T00:00:00Z" resolution: RESOLUTION_WEEKLY projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Body Parameters - `dateRange: DateRange` Date range to query within. - `endTime: string` End time of the date range (exclusive). - `startTime: string` Start time of the date range (inclusive). - `projectId: optional string` Optional project ID to scope results. - `resolution: optional Resolution` Time resolution for the series data. - `"RESOLUTION_UNSPECIFIED"` - `"RESOLUTION_HOURLY"` - `"RESOLUTION_DAILY"` - `"RESOLUTION_WEEKLY"` - `"RESOLUTION_MONTHLY"` - `teamId: optional string` Optional team ID to scope results to a specific team. Mutually exclusive with user_id. - `userId: optional string` Optional user ID to scope results to a specific user. Mutually exclusive with team_id. ### Returns - `timeSeries: optional array of PrTimeBucket` Time series of PR speed metrics, bucketed by the requested resolution. - `deploys: optional string` Total number of deploys (merged PRs) in this bucket. - `leadTimeSeconds: optional number` Median lead time in seconds for PRs merged in this bucket. - `prsMergedCount: optional string` Number of PRs merged in this bucket. - `startTime: optional string` Start of this time bucket. - `timeToFirstApprovalSeconds: optional number` Median time to first approval in seconds for PRs in this bucket. Zero when no PRs in the bucket had approvals. ### Example ```http curl https://app.gitpod.io/api/gitpod.v1.UsageService/GetPrTimeSeries \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $GITPOD_API_KEY" \ -d '{ "dateRange": { "endTime": "2024-02-01T00:00:00Z", "startTime": "2024-01-01T00:00:00Z" } }' ``` #### Response ```json { "timeSeries": [ { "deploys": "deploys", "leadTimeSeconds": 0, "prsMergedCount": "prsMergedCount", "startTime": "2019-12-27T18:11:19.117Z", "timeToFirstApprovalSeconds": 0 } ] } ```