| 508 | } |
| 509 | |
| 510 | func (f *fileScorer) queueString() string { |
| 511 | var res strings.Builder |
| 512 | e := f.queue.Front() |
| 513 | i := 0 |
| 514 | for e != nil { |
| 515 | v := e.Value.(queuedFile) |
| 516 | if i > 0 { |
| 517 | res.WriteByte('\n') |
| 518 | } |
| 519 | res.WriteString(fmt.Sprintf("%03d: %s (score: %.3f, bytes: %d)", i, v.name, v.score, v.size)) |
| 520 | i++ |
| 521 | e = e.Next() |
| 522 | } |
| 523 | return res.String() |
| 524 | } |
| 525 | |
| 526 | // bytesToClear() returns the number of bytes to clear to reach low watermark |
| 527 | // w.r.t quota given disk total and free space, quota in % allocated to cache |