Commit Graph

11 Commits

Author SHA1 Message Date
k1w1dev ef42e169b9 fix: Fix sonar issues (#2925)
* Remove unused member which was also causing a false positive sonar issue.
Fixes sonar issue https://sonarcloud.io/project/issues?open=AY3gHwu5DIZTZkppqVEG&id=iluwatar_java-design-patterns

* Fixes sonar issue https://sonarcloud.io/project/issues?open=AXK0OzDA-CiGJS70dLki&id=iluwatar_java-design-patterns
related to "Refactor the code of the lambda to not have multiple invocations throwing the same checked exception."

Also, updated the code to use Instant and Duration to deal with time instead of int. Added the awaitility
library to perform assertions in test which is more reliable than using Thread.sleep directly to wait for events to happen.

* checkstyle fix

* Add sneaky throws to fix sonar lint issue. This is fine as the newFile method is not being tested but instead the new SimpleFileWriter(...) is.

* The first booking needs to happen outside the assertions. Fixed other warnings

* Use records to pass around related objects instead of using a large number of
individual params, which sonar did not like.

* Checkstyle fixes

* checkstyle fixes

* Remove complexity to keep sonar happy.

* Split into different methods to reduce complexity. Could be broken down even further but currently Sonar is happy.

* Move files to correct package

* Add valid assertions to tests

* rename constants to avoid confusion

* Sonar warning related to cognitive complexity can be suppressed as the methods are quite generic and not functional enough to be separated out.

* Use constants to keep Sonar happy

* Use correct constant naming conventions

* Use correct constant naming conventions

* Use lombok to define noargsconstructor

* Use a single method to do the logging

* Remove unused constructor and redundant method

* Use a reusable method for logging
2024-05-04 08:20:01 +03:00
Ilkka Seppälä a2e4307044 refactor: health check 2024-04-25 20:18:07 +03:00
Ilkka Seppälä 63a2740210 docs: improve health check 2024-04-25 20:16:37 +03:00
Ilkka Seppälä 7c1889b8e5 refactor: update layers parent, reformat code, update license headers 2024-03-30 08:34:54 +02:00
Ilkka Seppälä 7d0874d88a deps: update maven 2024-03-27 20:09:01 +02:00
dependabot[bot] 7c516064c6 build(deps-dev): bump org.assertj:assertj-core from 3.24.2 to 3.25.3 (#2855)
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.24.2 to 3.25.3.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.24.2...assertj-build-3.25.3)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 18:03:39 +02:00
Jun Kang be914e0bc3 deps: Updated the imports in code of the healthcheck pattern for SpringBoot 3.x (#2851)
* Updated the imports in code of the single table inheritance pattern for Spring Boot 3.x

#2825
Change javax library to jakarta

* add pom.xml

* Updated the imports in code of the healthcheck pattern for SpringBoot 3.x

Change javax library to jakarta and update maven dependency versions

* change order of imports to pass Checkstyle violations

* change import order to pass lexicographical order test

* change import order to pass CustomImportOrder warning
2024-03-27 15:38:32 +02:00
Ilkka Seppälä b994d9a70d fix: Fix health-check page rendering error on the website 2024-02-11 10:32:26 +02:00
Doksanbir 45f63a70f1 docs: Update README.md for Health Check Pattern (#2783) 2024-01-27 13:16:06 +02:00
Ilkka Seppälä 4d21b48424 docs: Update health check category and tags 2023-12-02 15:03:21 +02:00
Doksanbir 21f7b026f5 pattern: Implement Health Check for Microservices Observability (#2695) (#2774)
* Add Health Check pattern implementation

The commit introduces  Health Check pattern, providing a series of health indicators for system performance and stability monitoring, including checks for system CPU load, process CPU load, database health, memory usage, and garbage collection metrics. It also includes asynchronous execution and caching mechanisms for health checks, and retry configurations for resilience.

Implements health checking components as per issue #2695.

* Test cases and javadoc for HealthEndpointIntegrationTest

* Added more log to test case to see why it returns 503

* Change config values to see if the system High system CPU load is resolved or not in CI.

* Fixes for test cases.

* some fixes for Sonar.

* some fixes for Sonar.
ADDED HIGH_PROCESS_CPU_LOAD_MESSAGE_WITHOUT_PARAM
ADDED HIGH_SYSTEM_CPU_LOAD_MESSAGE_WITHOUT_PARAM

* Sonar fixes address "Define and throw a dedicated exception instead of using a generic one."

added HealthCheckInterruptedException
refactored CustomHealthIndicator

* fixes checkstyle violation.
2023-12-02 14:17:01 +02:00