docs(storage): document consistency boundaries and reproducible checks
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
"""Plot only measured storage evidence; no reconstructed timing samples."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import matplotlib
|
||||
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("input")
|
||||
parser.add_argument("--output", default="evidence/storage-research.png")
|
||||
args = parser.parse_args()
|
||||
data = json.loads(Path(args.input).read_text())
|
||||
assert data["complete"]
|
||||
series = data["cost_research"]
|
||||
fig, axes = plt.subplots(1, 2, figsize=(11, 4), layout="constrained")
|
||||
for cell in series["cells"]:
|
||||
axes[0].scatter(
|
||||
cell["objects_scanned"],
|
||||
cell["duration_seconds"],
|
||||
color="#176b87",
|
||||
alpha=0.65,
|
||||
)
|
||||
axes[0].set(
|
||||
xlabel="Objects scanned (including real attachments)",
|
||||
ylabel="Dry-run duration, seconds",
|
||||
title="Inventory cost: 3 repeats per dataset",
|
||||
)
|
||||
measured = data["concurrent_uploads"]
|
||||
ids = sorted({s["container"] for s in measured["memory_samples"]})
|
||||
for i, cid in enumerate(ids):
|
||||
points = [
|
||||
s for s in measured["memory_samples"] if s["container"] == cid
|
||||
]
|
||||
axes[1].plot(
|
||||
[s["at"] for s in points],
|
||||
[s["memory.current"] / 2**20 for s in points],
|
||||
label=f"API {i + 1} cgroup current",
|
||||
)
|
||||
axes[1].set(
|
||||
xlabel="Time, seconds",
|
||||
ylabel="Memory, MiB",
|
||||
title="10 simultaneous uploads, verified downloads",
|
||||
)
|
||||
axes[1].legend(fontsize=8)
|
||||
for ax in axes:
|
||||
ax.grid(alpha=0.2)
|
||||
fig.savefig(args.output, dpi=160)
|
||||
print("Saved measured inventory and memory figure")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user