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

Method DownloadPeriodicMetrics

github/copilot.go:1199–1212  ·  view source on GitHub ↗

DownloadPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot usage metrics report from a download link returned by GetEnterpriseMetricsReport or GetOrganizationMetricsReport.

(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

1197// usage metrics report from a download link returned by GetEnterpriseMetricsReport or
1198// GetOrganizationMetricsReport.
1199func (s *CopilotService) DownloadPeriodicMetrics(ctx context.Context, url string) (*CopilotPeriodicMetrics, *Response, error) {
1200 resp, r, err := s.fetchMetricsReport(ctx, url)
1201 if err != nil {
1202 return nil, r, err
1203 }
1204 defer resp.Body.Close()
1205
1206 var metrics *CopilotPeriodicMetrics
1207 if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil {
1208 return nil, r, err
1209 }
1210
1211 return metrics, r, nil
1212}
1213
1214// DownloadUserDailyMetrics downloads the payload of a 1-day Copilot user metrics report from a
1215// download link returned by GetEnterpriseUsersDailyMetricsReport or

Calls 2

fetchMetricsReportMethod · 0.95
CloseMethod · 0.80