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

Method DownloadDailyMetrics

github/copilot.go:1181–1194  ·  view source on GitHub ↗

DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport.

(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

1179// DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a
1180// download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport.
1181func (s *CopilotService) DownloadDailyMetrics(ctx context.Context, url string) (*CopilotDailyMetrics, *Response, error) {
1182 resp, r, err := s.fetchMetricsReport(ctx, url)
1183 if err != nil {
1184 return nil, r, err
1185 }
1186 defer resp.Body.Close()
1187
1188 var metrics *CopilotDailyMetrics
1189 if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil {
1190 return nil, r, err
1191 }
1192
1193 return metrics, r, nil
1194}
1195
1196// DownloadPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot
1197// usage metrics report from a download link returned by GetEnterpriseMetricsReport or

Calls 2

fetchMetricsReportMethod · 0.95
CloseMethod · 0.80

Tested by 1