(row guestRow)
| 496 | } |
| 497 | |
| 498 | func formatMemoryCell(row guestRow) (string, float64) { |
| 499 | if row.memTotal <= 0 { |
| 500 | return utils.FormatBytes(row.memUsed), 0 |
| 501 | } |
| 502 | |
| 503 | percent := memoryRatio(row) * 100 |
| 504 | text := fmt.Sprintf("%s / %s (%.0f%%)", utils.FormatBytes(row.memUsed), utils.FormatBytes(row.memTotal), percent) |
| 505 | |
| 506 | return text, percent |
| 507 | } |
| 508 | |
| 509 | func formatMemorySummary(used, total string) string { |
| 510 | if total == api.StringNA { |
no test coverage detected