report
blobmap.report ¶
What is archivable, and what is not.
The number that matters when tiering is not working: how much data no policy can ever move. Three things put data in that category, and only one of them is visible without asking.
- hot -- metadata objects and dimension coordinates, held back so that opening a store never touches tape. Small and expected.
- pinned -- someone asked for it. Legitimate, but a pin nobody revisits is indistinguishable from a leak.
- unmanaged -- nothing claims it. A store that was never partitioned, a variable added after the last run, or a layout the partitioner did not recognise. This is the one that grows silently.
A bucket whose unmanaged share is climbing has something the partitioner is not seeing, and that is worth knowing long before the pool fills.
Report
dataclass
¶
Report(
scope: str,
archivable_bytes: int = 0,
hot_bytes: int = 0,
pinned_bytes: int = 0,
unmanaged_bytes: int = 0,
blobs: set[str] = set(),
objects: int = 0,
pins: int = 0,
expired_pins: int = 0,
)
Byte and object counts for one scope or bucket.
Attributes:
| Name | Type | Description |
|---|---|---|
scope |
str
|
What was counted. |
archivable_bytes |
int
|
Data a tiering policy is free to move. |
hot_bytes |
int
|
Metadata and coordinates, held back structurally. |
pinned_bytes |
int
|
Held back deliberately. |
unmanaged_bytes |
int
|
Claimed by nothing. The category that grows silently. |
blobs |
set[str]
|
Distinct blob instances seen. |
objects |
int
|
Objects counted. |
pins |
int
|
Pins in effect. |
expired_pins |
int
|
Pins whose review date has passed. |
held_fraction
property
¶
held_fraction: float
Get the share of the scope that tiering cannot touch, 0 to 1.
add ¶
add(kind: str, size: int) -> None
Count one object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
A |
required |
size
|
int
|
Object size in bytes. |
required |
Source code in src/blobmap/report.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
report ¶
report(
data: Store, manifests: ManifestStore, root: str = ""
) -> Report
Walk a prefix and classify every object against the manifests.
This is a full listing, so it costs what a partition run costs. It is a thing to run nightly or on demand, not per request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Store
|
Storage handle for the data. |
required |
manifests
|
ManifestStore
|
Where manifests live. |
required |
root
|
str
|
Prefix to count, or empty for everything. |
''
|
Returns:
| Type | Description |
|---|---|
Report
|
A |
Source code in src/blobmap/report.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
human ¶
human(n: float) -> str
Format a byte count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
float
|
Size in bytes. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A short binary-unit string. |
Example
human(1536) '1.5 KiB'
Source code in src/blobmap/report.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
render ¶
render(reports: list[Report]) -> str
Format reports as a table, worst first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reports
|
list[Report]
|
One per bucket or scope. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A table, followed by a warning for anything with a meaningful |
str
|
unmanaged share. |
Source code in src/blobmap/report.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |