-
Notifications
You must be signed in to change notification settings - Fork 3
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
Uptime percentage #61
Open
OrleneMitchell
wants to merge
66
commits into
develop
Choose a base branch
from
UptimePercentage
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e span for a specific service in order to calculate the service's uptime percentage,
…within a specified timeframe.
…he length of time a service is open.
…ime from the first record as this is not to be included as part of the calculation.
…n the service record are used to determine the services daily opening hours.
…e last record spans over days.
…ound. The created at date time on the record entity is needed as this is used to calculate the services uptime.
…ough the method UptimeTotal.
… managing multiple records using the created date and times and opening hours for a given service.
…ultiple records using the created date and times and opening hours for a given service.
tlheen
approved these changes
Aug 5, 2024
core/src/main/java/nav/statusplattform/core/openingHours/UpTimeCalculator.java
Outdated
Show resolved
Hide resolved
tlheen
reviewed
Aug 5, 2024
core/src/main/java/nav/statusplattform/core/openingHours/UpTimeCalculator.java
Outdated
Show resolved
Hide resolved
…te one to avoid unfortunate side effects.
…lass containing from and to date for the requested TimeSpan.
…because the class variable was not instantiated yet.
…ined and locally added to a map rather than accessed individually to make the code simpler to understand and run more effectively.
…able 'lastRecord.created' one day back to include the created day in the calculation.
…ay of the first record by setting the current record 'createdAt' one day back. In addition, redundant code was also removed as a result of the change.
…ge the last day of the record In addition, redundant code was also removed as a result of the change.
…move duplicate code.
…od to aid understanding of the code.
…d to aid understanding of the code.
Merk! Har en feilende test som er kommentert ut.
…n during opening hours.
… and taking 23:59 into account.
Signed-off-by: OrleneMitchell <[email protected]>
* Created an alternative solution with smaller building blocks * Fungerende versjon, men hvor kallkjeden ikke er optimal * Fixes a bug where to-date was null i the RecordIntervals * Tar i bruk ny kode i UptimeCalculator Merk! Har en feilende test som er kommentert ut. * Fixed calculation of total ActualExpectedUptime * Moves functionality for summing actual expected uptime to uptimeTotal * Tidying up - reducing visibility for some classes/methods * Moves calculation of opening hours in minutes * Removes methods that are not in use. * Takes into account that the start and the end of a timespan can happen during opening hours. * Fixes the issue with opening hours until 23:59 * Makes use of the same metod for calculating duration between to times and taking 23:59 into account. --------- Signed-off-by: OrleneMitchell <[email protected]> Co-authored-by: OrleneMitchell <[email protected]>
Signed-off-by: Terje Heen <[email protected]>
Uptime percentage v4
…d}/{TimeSpan} as part of setting up of the end points.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dette er den første kopien av koden for å beregne en tjenesteoppetid. Koden er basert på krav som finnes i Jira https://jira.adeo.no/browse/TSI-501