MCPcopy Create free account
hub / github.com/github/gh-aw / renderGitHubRateLimitDiffMarkdownSection

Function renderGitHubRateLimitDiffMarkdownSection

pkg/cli/audit_diff_render.go:588–607  ·  view source on GitHub ↗

renderGitHubRateLimitDiffMarkdownSection renders the GitHub API rate limit diff as markdown

(run1ID, run2ID int64, diff *GitHubRateLimitDiff)

Source from the content-addressed store, hash-verified

586
587// renderGitHubRateLimitDiffMarkdownSection renders the GitHub API rate limit diff as markdown
588func renderGitHubRateLimitDiffMarkdownSection(run1ID, run2ID int64, diff *GitHubRateLimitDiff) {
589 fmt.Fprintln(os.Stdout, "#### GitHub API Usage")
590 fmt.Fprintln(os.Stdout)
591 fmt.Fprintf(os.Stdout, "| Metric | Run #%d | Run #%d | Change |\n", run1ID, run2ID)
592 fmt.Fprintln(os.Stdout, "|--------|---------|---------|--------|")
593
594 if diff.Run1TotalAPICalls > 0 || diff.Run2TotalAPICalls > 0 {
595 fmt.Fprintf(os.Stdout, "| Total API calls | %d | %d | %s |\n", diff.Run1TotalAPICalls, diff.Run2TotalAPICalls, diff.APICallsChange)
596 }
597 if diff.Run1CoreConsumed > 0 || diff.Run2CoreConsumed > 0 {
598 fmt.Fprintf(os.Stdout, "| Core quota consumed | %d | %d | %s |\n", diff.Run1CoreConsumed, diff.Run2CoreConsumed, diff.CoreConsumedChange)
599 }
600 if diff.Run1CoreRemaining > 0 || diff.Run2CoreRemaining > 0 {
601 fmt.Fprintf(os.Stdout, "| Core remaining | %d | %d | — |\n", diff.Run1CoreRemaining, diff.Run2CoreRemaining)
602 }
603 if diff.Run1CoreLimit > 0 || diff.Run2CoreLimit > 0 {
604 fmt.Fprintf(os.Stdout, "| Core limit | %d | %d | — |\n", diff.Run1CoreLimit, diff.Run2CoreLimit)
605 }
606 fmt.Fprintln(os.Stdout)
607}
608
609// renderGitHubRateLimitDiffPrettySection renders the GitHub API rate limit diff as a pretty console sub-section
610func renderGitHubRateLimitDiffPrettySection(run1ID, run2ID int64, diff *GitHubRateLimitDiff) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected