Skip to content

Add byte-level metrics for create/update/delete payload operations#32

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-metrics-for-data-size
Draft

Add byte-level metrics for create/update/delete payload operations#32
Copilot wants to merge 4 commits intomainfrom
copilot/add-metrics-for-data-size

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

The store already counted create/update/delete operations, but it did not expose the corresponding data volume. This change adds byte-based metrics so writes and removals can be observed in terms of payload size, not just operation count.

  • Metrics added

    • Registers three new counters:
      • arkiv_store/creates_bytes
      • arkiv_store/updates_bytes
      • arkiv_store/deletes_bytes
  • Accounting changes

    • Extends per-block stats to accumulate payload bytes alongside existing operation counts.
    • Records bytes from the payload involved in each operation:
      • create: len(operation.Create.Content)
      • update: len(operation.Update.Content)
      • delete/expire: len(latestPayload.Payload) for the payload actually removed
  • Batch reporting

    • Includes create/update/delete byte totals in batch-level logging so operational logs match the new counters.
  • Coverage

    • Adds focused test coverage for byte counters across create → update → delete flow, asserting counter deltas match the payload sizes processed.
metricCreatesBytes = metrics.NewRegisteredCounter("arkiv_store/creates_bytes", nil)
metricUpdatesBytes = metrics.NewRegisteredCounter("arkiv_store/updates_bytes", nil)
metricDeletesBytes = metrics.NewRegisteredCounter("arkiv_store/deletes_bytes", nil)

blockStat.createsBytes += len(operation.Create.Content)
blockStat.updatesBytes += len(operation.Update.Content)
blockStat.deletesBytes += len(latestPayload.Payload)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 3 commits March 9, 2026 13:56
Co-authored-by: scx1332 <27012161+scx1332@users.noreply.github.com>
Co-authored-by: scx1332 <27012161+scx1332@users.noreply.github.com>
Co-authored-by: scx1332 <27012161+scx1332@users.noreply.github.com>
Copilot AI changed the title [WIP] Add metrics for data creation, updates, and deletions in bytes Add byte-level metrics for create/update/delete payload operations Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants