Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions github/copilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,19 +1064,25 @@ type CopilotMetricsAIAdoptionPhaseTotals struct {

// CopilotDailyMetrics represents the payload downloaded from a 1-day Copilot usage metrics report.
type CopilotDailyMetrics struct {
Day string `json:"day"`
OrganizationID *string `json:"organization_id,omitempty"`
EnterpriseID *string `json:"enterprise_id,omitempty"`
DailyActiveCLIUsers *int `json:"daily_active_cli_users,omitempty"`
DailyActiveUsers *int `json:"daily_active_users,omitempty"`
DailyActiveCopilotCloudAgentUsers *int `json:"daily_active_copilot_cloud_agent_users,omitempty"`
WeeklyActiveUsers *int `json:"weekly_active_users,omitempty"`
WeeklyActiveCopilotCloudAgentUsers *int `json:"weekly_active_copilot_cloud_agent_users,omitempty"`
MonthlyActiveUsers *int `json:"monthly_active_users,omitempty"`
MonthlyActiveChatUsers *int `json:"monthly_active_chat_users,omitempty"`
MonthlyActiveAgentUsers *int `json:"monthly_active_agent_users,omitempty"`
MonthlyActiveCopilotCloudAgentUsers *int `json:"monthly_active_copilot_cloud_agent_users,omitempty"`
UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"`
Day string `json:"day"`
OrganizationID *string `json:"organization_id,omitempty"`
EnterpriseID *string `json:"enterprise_id,omitempty"`
DailyActiveCLIUsers *int `json:"daily_active_cli_users,omitempty"`
DailyActiveUsers *int `json:"daily_active_users,omitempty"`
DailyActiveCopilotCloudAgentUsers *int `json:"daily_active_copilot_cloud_agent_users,omitempty"`
WeeklyActiveUsers *int `json:"weekly_active_users,omitempty"`
WeeklyActiveCopilotCloudAgentUsers *int `json:"weekly_active_copilot_cloud_agent_users,omitempty"`
MonthlyActiveUsers *int `json:"monthly_active_users,omitempty"`
MonthlyActiveChatUsers *int `json:"monthly_active_chat_users,omitempty"`
MonthlyActiveAgentUsers *int `json:"monthly_active_agent_users,omitempty"`
MonthlyActiveCopilotCloudAgentUsers *int `json:"monthly_active_copilot_cloud_agent_users,omitempty"`
DailyActiveCopilotCodeReviewUsers *int `json:"daily_active_copilot_code_review_users,omitempty"`
WeeklyActiveCopilotCodeReviewUsers *int `json:"weekly_active_copilot_code_review_users,omitempty"`
MonthlyActiveCopilotCodeReviewUsers *int `json:"monthly_active_copilot_code_review_users,omitempty"`
DailyPassiveCopilotCodeReviewUsers *int `json:"daily_passive_copilot_code_review_users,omitempty"`
WeeklyPassiveCopilotCodeReviewUsers *int `json:"weekly_passive_copilot_code_review_users,omitempty"`
MonthlyPassiveCopilotCodeReviewUsers *int `json:"monthly_passive_copilot_code_review_users,omitempty"`
UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"`
CopilotMetricsChatPanel
CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"`
CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"`
Expand Down
38 changes: 29 additions & 9 deletions github/copilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3035,8 +3035,14 @@ func TestCopilotService_DownloadDailyMetrics(t *testing.T) {
"organization_id": "123",
"daily_active_cli_users": 2,
"daily_active_users": 10,
"daily_active_copilot_code_review_users": 3,
"daily_passive_copilot_code_review_users": 1,
"weekly_active_users": 20,
"weekly_active_copilot_code_review_users": 8,
"weekly_passive_copilot_code_review_users": 2,
"monthly_active_users": 30,
"monthly_active_copilot_code_review_users": 15,
"monthly_passive_copilot_code_review_users": 4,
"chat_panel_ask_mode": 4,
"totals_by_ide": [
{"ide": "vscode", "user_initiated_interaction_count": 5, "loc_added_sum": 100}
Expand Down Expand Up @@ -3113,12 +3119,18 @@ func TestCopilotService_DownloadDailyMetrics(t *testing.T) {
}

want := &CopilotDailyMetrics{
Day: "2026-04-01",
OrganizationID: Ptr("123"),
DailyActiveCLIUsers: Ptr(2),
DailyActiveUsers: Ptr(10),
WeeklyActiveUsers: Ptr(20),
MonthlyActiveUsers: Ptr(30),
Day: "2026-04-01",
OrganizationID: Ptr("123"),
DailyActiveCLIUsers: Ptr(2),
DailyActiveUsers: Ptr(10),
DailyActiveCopilotCodeReviewUsers: Ptr(3),
DailyPassiveCopilotCodeReviewUsers: Ptr(1),
WeeklyActiveUsers: Ptr(20),
WeeklyActiveCopilotCodeReviewUsers: Ptr(8),
WeeklyPassiveCopilotCodeReviewUsers: Ptr(2),
MonthlyActiveUsers: Ptr(30),
MonthlyActiveCopilotCodeReviewUsers: Ptr(15),
MonthlyPassiveCopilotCodeReviewUsers: Ptr(4),
CopilotMetricsChatPanel: CopilotMetricsChatPanel{
ChatPanelAskMode: Ptr(4),
},
Expand Down Expand Up @@ -3228,6 +3240,10 @@ func TestCopilotService_DownloadPeriodicMetrics(t *testing.T) {
"day": "2026-03-05",
"daily_active_cli_users": 2,
"daily_active_users": 5,
"daily_active_copilot_code_review_users": 2,
"daily_passive_copilot_code_review_users": 1,
"weekly_active_copilot_code_review_users": 6,
"monthly_active_copilot_code_review_users": 12,
"totals_by_cli": {
"session_count": 1,
"request_count": 2,
Expand Down Expand Up @@ -3266,9 +3282,13 @@ func TestCopilotService_DownloadPeriodicMetrics(t *testing.T) {
CreatedAt: refTimestamp(1136178000),
DayTotals: []*CopilotDailyMetrics{
{
Day: "2026-03-05",
DailyActiveCLIUsers: Ptr(2),
DailyActiveUsers: Ptr(5),
Day: "2026-03-05",
DailyActiveCLIUsers: Ptr(2),
DailyActiveUsers: Ptr(5),
DailyActiveCopilotCodeReviewUsers: Ptr(2),
DailyPassiveCopilotCodeReviewUsers: Ptr(1),
WeeklyActiveCopilotCodeReviewUsers: Ptr(6),
MonthlyActiveCopilotCodeReviewUsers: Ptr(12),
TotalsByCLI: &CopilotMetricsCLI{
SessionCount: Ptr(1),
RequestCount: Ptr(2),
Expand Down
48 changes: 48 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading