GetCoAuthorTimeSeries
usage.get_co_author_time_series(UsageGetCoAuthorTimeSeriesParams**kwargs) -> UsageGetCoAuthorTimeSeriesResponse
POST/gitpod.v1.UsageService/GetCoAuthorTimeSeries
Gets co-author contribution data as a time series.
Use this method to:
- Chart AI-assisted commits and line changes over time
- Select hourly, daily, weekly, or monthly buckets
- Scope co-author insights to a project, user, or team
Example
dateRange:
startTime: "2024-01-01T00:00:00Z"
endTime: "2024-02-01T00:00:00Z"
resolution: RESOLUTION_WEEKLY
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"ParametersExpand Collapse
ReturnsExpand Collapse
class UsageGetCoAuthorTimeSeriesResponse: …
class UsageGetCoAuthorTimeSeriesResponse: …
GetCoAuthorTimeSeries
import os
from datetime import datetime
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
response = client.usage.get_co_author_time_series(
date_range={
"end_time": datetime.fromisoformat("2024-02-01T00:00:00"),
"start_time": datetime.fromisoformat("2024-01-01T00:00:00"),
},
project_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
resolution="RESOLUTION_WEEKLY",
)
print(response.time_series){
"timeSeries": [
{
"aiRatio": 0,
"byTool": [
{
"commits": "commits",
"distinctAuthors": "distinctAuthors",
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"tool": "CO_AUTHOR_TOOL_UNSPECIFIED"
}
],
"distinctAuthors": "distinctAuthors",
"startTime": "2019-12-27T18:11:19.117Z",
"totalCommits": "totalCommits",
"totalLinesAdded": "totalLinesAdded",
"totalLinesRemoved": "totalLinesRemoved"
}
]
}Returns Examples
{
"timeSeries": [
{
"aiRatio": 0,
"byTool": [
{
"commits": "commits",
"distinctAuthors": "distinctAuthors",
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"tool": "CO_AUTHOR_TOOL_UNSPECIFIED"
}
],
"distinctAuthors": "distinctAuthors",
"startTime": "2019-12-27T18:11:19.117Z",
"totalCommits": "totalCommits",
"totalLinesAdded": "totalLinesAdded",
"totalLinesRemoved": "totalLinesRemoved"
}
]
}