Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixup(golang/.../vstorage/keeper): report absolute values for metrics increase/decrease #11101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siarhei-agoric
Copy link
Contributor

closes: #11062

Description

We need to report absolute values for vstorage metrics increase/decrease as requested in #11063 (review)

Security Considerations

N/A

Scaling Considerations

N/A

Documentation Considerations

store_size_increase and store_size_decrease metrics represent total writes and deletes issued respectively, which may differ from the total number of bytes committed/freed to/from the store due to the store's internal implementation.

Testing Considerations

vstorage metrics test passed:

2025-03-11T16:06:25.744Z shutdown: Shutting down cleanly...
2025-03-11T16:06:25.745Z shutdown: Process terminated!
make: *** [Makefile:155: scenario2-run-chain] Error 98
  ✔ vstorage metrics (1m 14.8s)
    ℹ query vstorage path published.wallet.agoric1cuh05y5l2uhphv2995k5qhdg5crvs396ud7rv9 exits successfully
    ℹ metric start values: {
        'store_size_decrease{storeKey="vstorage"}': 1106,
        'store_size_increase{storeKey="vstorage"}': 1145,
      }
    ℹ query vstorage path published.wallet.agoric1cuh05y5l2uhphv2995k5qhdg5crvs396ud7rv9 exits successfully
    ℹ provisioned wallet agoric1cuh05y5l2uhphv2995k5qhdg5crvs396ud7rv9 is published
    ℹ metric stop values: {
        'store_size_decrease{storeKey="vstorage"}': 2180,
        'store_size_increase{storeKey="vstorage"}': 3585,
      }
  ─

  1 test passed
Done in 654.27s.

Upgrade Considerations

N/A

@siarhei-agoric siarhei-agoric requested a review from a team as a code owner March 11, 2025 16:16
Copy link

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: e72f034
Status: ✅  Deploy successful!
Preview URL: https://ddbec154.agoric-sdk.pages.dev
Branch Preview URL: https://sliakh-11062-use-actual-size-8jzs.agoric-sdk.pages.dev

View logs

func ReportStoreSizeMetrics(k Keeper, sizeDelta float32) {
// reportStoreSizeMetrics exports store size increase/decrease metrics
// when Cosmos telemetry is enabled.
func (k Keeper) reportStoreSizeMetrics(increase int, decrease int) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using uint for increase and increase forces unnecessary type conversions later in the code, so I am going to stick to int here.

x/vstorage/keeper/keeper.go:242:31: cannot use len(key) + len(rawValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:399:32: cannot use len(encodedKey) + len(oldRawValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:403:29: cannot use len(types.EncodedNoDataValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:403:60: cannot use len(oldRawValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:409:28: cannot use len(newRawValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:409:46: cannot use len(oldRawValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:424:32: cannot use len(encodedAncestor) + len(types.EncodedNoDataValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics
x/vstorage/keeper/keeper.go:436:29: cannot use len(encodedAncestor) + len(types.EncodedNoDataValue) (value of type int) as uint value in argument to k.reportStoreSizeMetrics

@mhofman
Copy link
Member

mhofman commented Mar 11, 2025

For reference, this PR replaces #11080

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.

agd throws panic: counter cannot decrease in value
2 participants