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

[rrd4j] Improve querying the RRD4jPersistenceService #16360

Merged
merged 1 commit into from Feb 5, 2024

Conversation

joerg1985
Copy link
Contributor

Description

This PR does some small improvements to querying the RRD4jPersistenceService:

  • detects the target type for the state only once, it does not change for the complete query
  • uses ZonedDateTime.plusSeconds, it is faster than ZonedDateTime.ofInstant all the time ²
  • fixes suppressed warnings

² when using ZonedDateTime.ofInstant more objects are created than calling ZonedDateTime.plusSeconds, e.g.:

  • a new LocatDate is created for each call, even when it is the same date like the last call
  • the Instant.ofEpochSecond call will create a Instant
  • ZoneId.systemDefault() will clone the timezone internally

Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
@joerg1985 joerg1985 requested a review from a team as a code owner February 3, 2024 19:34
@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Feb 3, 2024
@jlaur jlaur changed the title Improved querying the RRD4jPersistenceService [rrd4j] Improve querying the RRD4jPersistenceService Feb 3, 2024
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvement

@J-N-K J-N-K added this to the 4.2 milestone Feb 5, 2024
@J-N-K J-N-K merged commit e3d5e5d into openhab:main Feb 5, 2024
3 checks passed
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants