MCPcopy Index your code
hub / github.com/google/go-github / TestCopilotService_DownloadDailyMetrics

Function TestCopilotService_DownloadDailyMetrics

github/copilot_test.go:3066–3198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3064}
3065
3066func TestCopilotService_DownloadDailyMetrics(t *testing.T) {
3067 t.Parallel()
3068 client, mux, _ := setup(t)
3069
3070 mux.HandleFunc("/path/to/daily", func(w http.ResponseWriter, r *http.Request) {
3071 testMethod(t, r, "GET")
3072 fmt.Fprint(w, `{
3073 "day": "2026-04-01",
3074 "organization_id": "123",
3075 "daily_active_cli_users": 2,
3076 "daily_active_users": 10,
3077 "weekly_active_users": 20,
3078 "monthly_active_users": 30,
3079 "chat_panel_ask_mode": 4,
3080 "totals_by_ide": [
3081 {"ide": "vscode", "user_initiated_interaction_count": 5, "loc_added_sum": 100}
3082 ],
3083 "totals_by_feature": [
3084 {"feature": "completion", "user_initiated_interaction_count": 5},
3085 {"feature": "agent_edit", "loc_added_sum": 7, "loc_deleted_sum": 2}
3086 ],
3087 "totals_by_language_feature": [
3088 {"language": "go", "feature": "completion", "code_generation_activity_count": 3}
3089 ],
3090 "totals_by_language_model": [
3091 {"language": "go", "model": "m1", "code_generation_activity_count": 3}
3092 ],
3093 "totals_by_model_feature": [
3094 {"model": "m1", "feature": "completion", "user_initiated_interaction_count": 5}
3095 ],
3096 "totals_by_cli": {
3097 "session_count": 3,
3098 "request_count": 4,
3099 "prompt_count": 2,
3100 "token_usage": {
3101 "avg_tokens_per_request": 4123.5,
3102 "output_tokens_sum": 7000,
3103 "prompt_tokens_sum": 9494
3104 }
3105 },
3106 "loc_added_sum": 100,
3107 "pull_requests": {
3108 "total_reviewed": 1,
3109 "total_created": 2,
3110 "median_minutes_to_merge": 12.5,
3111 "median_minutes_to_merge_copilot_authored": 4.5,
3112 "median_minutes_to_merge_copilot_reviewed": 6.5
3113 }
3114 }`)
3115 })
3116
3117 ctx := t.Context()
3118 url := client.baseURL.String() + "path/to/daily"
3119 got, resp, err := client.Copilot.DownloadDailyMetrics(ctx, url)
3120 if err != nil {
3121 t.Errorf("Copilot.DownloadDailyMetrics returned error: %v", err)
3122 }
3123 if resp.StatusCode != http.StatusOK {

Callers

nothing calls this directly

Calls 7

testMethodFunction · 0.85
DownloadDailyMetricsMethod · 0.80
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…