Skip to content

[improve][broker][pip-431] PIP-431: Add Creation and Last Publish Timestamps to Topic Stats #24471

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

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

codelipenghui
Copy link
Contributor

Motivation

Implement PIP-431 #24469

Need to rebase master branch after #24469 merged

Modifications

  • Introduced methods to retrieve the last successful add entry time and the creation timestamp of the managed ledger metadata.
  • Updated ManagedLedgerImpl to implement these new methods.
  • Enhanced PersistentTopic to utilize these timestamps for topic statistics.
  • Added unit tests to verify the correct functionality of the new timestamps in various scenarios.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@codelipenghui codelipenghui added this to the 4.1.0 milestone Jun 28, 2025
@codelipenghui codelipenghui self-assigned this Jun 28, 2025
@codelipenghui codelipenghui added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages ready-to-test labels Jun 28, 2025
@github-actions github-actions bot added PIP doc-complete Your PR changes impact docs and the related docs have been already added. labels Jun 28, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2025

Codecov Report

Attention: Patch coverage is 73.46939% with 13 lines in your changes missing coverage. Please review.

Project coverage is 74.22%. Comparing base (bbc6224) to head (ffa0a58).
Report is 1183 commits behind head on master.

Files with missing lines Patch % Lines
...sar/broker/service/persistent/PersistentTopic.java 75.00% 8 Missing and 1 partial ⚠️
...a/org/apache/bookkeeper/mledger/ManagedLedger.java 0.00% 2 Missing ⚠️
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 50.00% 0 Missing and 1 partial ⚠️
...sar/common/policies/data/stats/TopicStatsImpl.java 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24471      +/-   ##
============================================
+ Coverage     73.57%   74.22%   +0.64%     
+ Complexity    32624    32435     -189     
============================================
  Files          1877     1868       -9     
  Lines        139502   146239    +6737     
  Branches      15299    16814    +1515     
============================================
+ Hits         102638   108539    +5901     
- Misses        28908    29113     +205     
- Partials       7956     8587     +631     
Flag Coverage Δ
inttests 26.78% <48.97%> (+2.20%) ⬆️
systests 23.42% <61.22%> (-0.91%) ⬇️
unittests 73.66% <73.46%> (+0.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 81.42% <50.00%> (+0.76%) ⬆️
...sar/common/policies/data/stats/TopicStatsImpl.java 91.97% <88.88%> (-1.33%) ⬇️
...a/org/apache/bookkeeper/mledger/ManagedLedger.java 0.00% <0.00%> (ø)
...sar/broker/service/persistent/PersistentTopic.java 80.62% <75.00%> (+2.16%) ⬆️

... and 1088 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…estamps to Topic Stats

- Introduced methods to retrieve the last successful add entry time and the creation timestamp of the managed ledger metadata.
- Updated ManagedLedgerImpl to implement these new methods.
- Enhanced PersistentTopic to utilize these timestamps for topic statistics.
- Added unit tests to verify the correct functionality of the new timestamps in various scenarios.
@codelipenghui codelipenghui force-pushed the penghui/impl-pip-431 branch from 965a2e5 to ffa0a58 Compare July 3, 2025 16:10
@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit de9c728 into apache:master Jul 8, 2025
197 of 217 checks passed
@codelipenghui codelipenghui deleted the penghui/impl-pip-431 branch July 8, 2025 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-complete Your PR changes impact docs and the related docs have been already added. PIP ready-to-test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants