From c9e399c22cd70401ca8266dbc653fa50203dd790 Mon Sep 17 00:00:00 2001 From: Shiwei Zhang Date: Fri, 21 Jul 2023 23:53:46 +0800 Subject: [PATCH] fea!: reduce contributor data Signed-off-by: Shiwei Zhang --- cmd/gha/report.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cmd/gha/report.go b/cmd/gha/report.go index d41a4c2..46a747e 100644 --- a/cmd/gha/report.go +++ b/cmd/gha/report.go @@ -174,18 +174,18 @@ func printIssueSummaryTable(authors map[string]*analysis.RepositorySummary) { nameSize = len(entry.Key) } } - headerFormat := fmt.Sprintf("| %%-%ds | %%-6s | %%-6s | %%-6s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) - bodyFormat := fmt.Sprintf("| %%-%ds | %%-6d | %%-6d | %%-6d | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) + headerFormat := fmt.Sprintf("| %%-%ds | %%-6s | %%-6s | %%-6s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) + bodyFormat := fmt.Sprintf("| %%-%ds | %%-6d | %%-6d | %%-6d | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) fmt.Println() - fmt.Printf(headerFormat, "Author", "Total", "Open", "Closed", "Min", "Max", "Mean", "Median", "P90", "P95", "P99") - fmt.Printf("|%s|--------|--------|--------|----------|----------|----------|----------|----------|----------|----------|\n", strings.Repeat("-", nameSize+2)) + fmt.Printf(headerFormat, "Author", "Total", "Open", "Closed", "Min", "Max", "Mean", "Median", "P90") + fmt.Printf("|%s|--------|--------|--------|----------|----------|----------|----------|----------|\n", strings.Repeat("-", nameSize+2)) // print body for _, entry := range counts { author := entry.Key summary := authors[author].Issue if len(summary.Durations) == 0 { - fmt.Printf(bodyFormat, author, summary.Total, summary.Open, summary.Closed, "", "", "", "", "", "", "") + fmt.Printf(bodyFormat, author, summary.Total, summary.Open, summary.Closed, "", "", "", "", "") continue } @@ -196,8 +196,6 @@ func printIssueSummaryTable(authors map[string]*analysis.RepositorySummary) { formatDuration(math.Mean(summary.Durations)), formatDuration(math.Median(summary.Durations)), formatDuration(math.Percentile(summary.Durations, 0.9)), - formatDuration(math.Percentile(summary.Durations, 0.95)), - formatDuration(math.Percentile(summary.Durations, 0.99)), ) } } @@ -220,18 +218,18 @@ func printPullRequestSummaryTable(authors map[string]*analysis.RepositorySummary nameSize = len(entry.Key) } } - headerFormat := fmt.Sprintf("| %%-%ds | %%-6s | %%-6s | %%-6s | %%-6s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) - bodyFormat := fmt.Sprintf("| %%-%ds | %%-6d | %%-6d | %%-6d | %%-6d | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) + headerFormat := fmt.Sprintf("| %%-%ds | %%-6s | %%-6s | %%-6s | %%-6s | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) + bodyFormat := fmt.Sprintf("| %%-%ds | %%-6d | %%-6d | %%-6d | %%-6d | %%-8s | %%-8s | %%-8s | %%-8s | %%-8s |\n", nameSize) fmt.Println() - fmt.Printf(headerFormat, "Author", "Total", "Open", "Closed", "Merged", "Min", "Max", "Mean", "Median", "P90", "P95", "P99") - fmt.Printf("|%s|--------|--------|--------|--------|----------|----------|----------|----------|----------|----------|----------|\n", strings.Repeat("-", nameSize+2)) + fmt.Printf(headerFormat, "Author", "Total", "Open", "Closed", "Merged", "Min", "Max", "Mean", "Median", "P90") + fmt.Printf("|%s|--------|--------|--------|--------|----------|----------|----------|----------|----------|\n", strings.Repeat("-", nameSize+2)) // print body for _, entry := range counts { author := entry.Key summary := authors[author].PullRequest if len(summary.Durations) == 0 { - fmt.Printf(bodyFormat, author, summary.Total, summary.Open, summary.Closed, summary.Merged, "", "", "", "", "", "", "") + fmt.Printf(bodyFormat, author, summary.Total, summary.Open, summary.Closed, summary.Merged, "", "", "", "", "") continue } @@ -242,8 +240,6 @@ func printPullRequestSummaryTable(authors map[string]*analysis.RepositorySummary formatDuration(math.Mean(summary.Durations)), formatDuration(math.Median(summary.Durations)), formatDuration(math.Percentile(summary.Durations, 0.9)), - formatDuration(math.Percentile(summary.Durations, 0.95)), - formatDuration(math.Percentile(summary.Durations, 0.99)), ) } }