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

Method DownloadUserPeriodicMetrics

github/copilot.go:1239–1251  ·  view source on GitHub ↗

DownloadUserPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot user metrics report from a download link returned by GetEnterpriseUsersMetricsReport or GetOrganizationUsersMetricsReport. The response is newline-delimited JSON, with one CopilotUserPeriodicMetrics recor

(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

1237// The response is newline-delimited JSON, with one CopilotUserPeriodicMetrics record per
1238// user-day in the reporting window.
1239func (s *CopilotService) DownloadUserPeriodicMetrics(ctx context.Context, url string) ([]*CopilotUserPeriodicMetrics, *Response, error) {
1240 resp, r, err := s.fetchMetricsReport(ctx, url)
1241 if err != nil {
1242 return nil, r, err
1243 }
1244 defer resp.Body.Close()
1245
1246 records, err := decodeNDJSONMetrics[CopilotUserPeriodicMetrics](resp.Body)
1247 if err != nil {
1248 return nil, r, err
1249 }
1250 return records, r, nil
1251}

Calls 2

fetchMetricsReportMethod · 0.95
CloseMethod · 0.80