Readings and last good nights are the owners' published packages: disk-load's diskreadings and restic's backupgood, taken by series (B5b Left 3; ADR 0634 §4; issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -15,8 +15,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings"
|
||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||
"git.novox.be/novox/mesh-sdk/go/health"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -32,7 +32,7 @@ type Item = catalogue.PlacedDataItem
|
||||
// its newest good backup.
|
||||
type ItemReport struct {
|
||||
Item
|
||||
health.Measured
|
||||
diskreadings.Measured
|
||||
// Peak is the largest size in the last seven days, on PeakDay.
|
||||
Peak *int64 `json:"peak_bytes,omitempty"`
|
||||
PeakDay string `json:"peak_day,omitempty"`
|
||||
@@ -59,8 +59,8 @@ func (b *Backups) Items() (map[string][]Item, error) {
|
||||
|
||||
// Measurements is the newest reading disk-load keeps of each item on this machine, by module and item (its state
|
||||
// `readings`, ADR 0571 clause 3); none where it cannot be read, which `backed-up` then says as no reading.
|
||||
func (b *Backups) Measurements() map[string]map[string]health.Reading {
|
||||
out := map[string]map[string]health.Reading{}
|
||||
func (b *Backups) Measurements() map[string]map[string]diskreadings.Reading {
|
||||
out := map[string]map[string]diskreadings.Reading{}
|
||||
if b.Readings == nil {
|
||||
return out
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (b *Backups) Measurements() map[string]map[string]health.Reading {
|
||||
}
|
||||
for _, r := range rs {
|
||||
if out[r.Module] == nil {
|
||||
out[r.Module] = map[string]health.Reading{}
|
||||
out[r.Module] = map[string]diskreadings.Reading{}
|
||||
}
|
||||
out[r.Module][r.ID] = r
|
||||
}
|
||||
@@ -107,7 +107,7 @@ func (b *Backups) recordGood(module string, at time.Time) {
|
||||
|
||||
// itemReports is every item of one module, with its newest reading and its newest good backup: the
|
||||
// module's newest good night, where that night keeps the path that covers the item.
|
||||
func itemReports(its []Item, measured map[string]health.Reading, paths []string, good time.Time) []ItemReport {
|
||||
func itemReports(its []Item, measured map[string]diskreadings.Reading, paths []string, good time.Time) []ItemReport {
|
||||
out := []ItemReport{}
|
||||
for _, it := range its {
|
||||
r := ItemReport{Item: it}
|
||||
|
||||
Reference in New Issue
Block a user