no data
" + } + const w, h, pad = 860.0, 272.0, 46.0 + top := 1.0 + for _, k := range weeks { + if k.P90 > top { + top = k.P90 + } + } + top *= 1.15 + n := len(weeks) + step := (w - pad*2) / math1(n-1) + x := func(i int) float64 { return pad + float64(i)*step } + y := func(v float64) float64 { return h - pad - (v/top)*(h-pad*2) } + + var b strings.Builder + fmt.Fprintf(&b, "") + return b.String() +} + +func math1(n int) float64 { + if n < 1 { + return 1 + } + return float64(n) +} + +type barRow struct { + Name string + Queue float64 + Exec float64 + Runs int + Skipped int +} + +func stackedBars(rows []barRow) string { + if len(rows) == 0 { + return "no data
" + } + const w, bar, pad = 860.0, 26.0, 210.0 + top := 0.0 + for _, r := range rows { + if r.Queue+r.Exec > top { + top = r.Queue + r.Exec + } + } + if top == 0 { + top = 1 + } + span := w - pad - 90 + h := float64(len(rows))*(bar+8) + 16 + + var b strings.Builder + fmt.Fprintf(&b, "") + return b.String() +} + +func quotaBar(c CacheState) string { + used := c.TotalGB / quotaGB * 100 + if used > 100 { + used = 100 + } + cls := "ok" + if used >= 90 { + cls = "over" + } else if used >= 75 { + cls = "warn" + } + return fmt.Sprintf("Nothing is dominating the wall clock right now.
") + } + + type famRow struct { + name string + size float64 + } + var fams []famRow + for n, s := range cache.Families { + fams = append(fams, famRow{n, s}) + } + sort.Slice(fams, func(i, j int) bool { + if fams[i].size == fams[j].size { + return fams[i].name < fams[j].name + } + return fams[i].size > fams[j].size + }) + var famHTML strings.Builder + for i, f := range fams { + if i >= 8 { + break + } + fmt.Fprintf(&famHTML, "| Job | Runs where it was last | Share |
|---|---|---|
| %s | %d | %.0f%% |
%.2f GB is stored on gh-readonly-queue refs. "+
+ "Those branches are deleted when the merge queue drains, so the entries can never be restored but still count against quota.
%s · workflow %s · %d successful runs (%s) ·
+per-job detail from the most recent %d runs · generated %s
Largest families. GitHub allows %.0f GB per repository and +evicts least-recently-used entries once full.
+| Family | Size | Quota | Copies |
|---|