Skip to content

Add public Cache.RemainingCost() method#448

Merged
mangalaman93 merged 3 commits intodgraph-io:mainfrom
xl-s:add-cap-method
Apr 21, 2025
Merged

Add public Cache.RemainingCost() method#448
mangalaman93 merged 3 commits intodgraph-io:mainfrom
xl-s:add-cap-method

Conversation

@xl-s
Copy link
Contributor

@xl-s xl-s commented Apr 11, 2025

Description

Currently, there's no way to deduce how much of the max capacity is being used in a cache instance. This adds a new Cap() method that enables this. Some cases where this is useful:

  • Monitoring the cache usage trend to facilitate better cache sizing
  • Decide whether to apply backpressure to data fetching based on the available capacity

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

@xl-s xl-s requested a review from a team April 11, 2025 16:17
@xl-s
Copy link
Contributor Author

xl-s commented Apr 19, 2025

Updated it

@xl-s xl-s changed the title Add public Cache.Cap() method Add public Cache.RemainingCost() method Apr 19, 2025
@mangalaman93 mangalaman93 enabled auto-merge (squash) April 21, 2025 04:28
@mangalaman93 mangalaman93 merged commit afbad37 into dgraph-io:main Apr 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants