simonbence opened a new pull request #4420:
URL: https://github.com/apache/nifi/pull/4420


   [NIFI-7429](https://issues.apache.org/jira/browse/NIFI-7429)
   
   This is a proposal for having historical data about the NiFi node’s status 
appearing in the NiFi UI. The main purpose was to provide a simple tool makes 
it possible to check basic performance metrics on the UI.
   
   From implementation perspective the solution is based on the existing status 
history function which was applied for components like processors. In front end 
side, the existing code is reused as much as possible, only some minor 
extension and duplication were needed. The main differences compared to the 
existing uses were the different trigger (this is reachable from the global 
menu) and the lack of some parameters like id or group.
   
   The backend side builds on top of VolatileComponentStatusRepository which 
already responsible for such functions. I tried to add is as an integral part 
of the existing metric collection, so the frequency of the measurements and the 
way of triggering is not separated. The metrics themselves are distilled from 
the SystemDiagnostics and the already collected GarbageCollectionStatus.
   
   Creating the snapshots came with three non-trivial cases I would like to 
highlight:
   
   1. The GC metrics are not predefined as the type of GC is depending on the 
running environment and on the actual collectors. This prevented pre-defining 
the descriptors for them, thus these are created during requests.
   2. Also, some GC metrics (time spent, counters) are growing in monotonous 
way as the metric collection stores the value shows the accumulated value from 
the start of the instance. In order to be able to provide the increment since 
the last measurement, the collection of the GC metrics are using the previous 
snapshot as baseline.
   3. The processor load average (usually in the form of “2.3” or alike) does 
not fit into the “long” format used by the functionality without significant 
information loss. In order to avoid bigger refactors, I introduced a new 
formatter type, named “FRACTION”. By convention the server side multiplies 
these metrics using a predefined number (1_000_000 for now) and during 
visualisation the frontend divides the metric value with the same number. By 
this, we shift the relevant digits into long value range. Of course, this still 
comes with precision loss, but for visualisation purposes, this looks 
sufficient.
   
   Thank you for your time and response!
   
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [ ] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
   
   - [ ] Has your PR been rebased against the latest commit within the target 
branch (typically `main`)?
   
   - [ ] Is your initial contribution a single, squashed commit? _Additional 
commits in response to PR reviewer feedback should be made on this branch and 
pushed to allow change tracking. Do not `squash` or use `--force` when pushing 
to allow for clean monitoring of changes._
   
   ### For code changes:
   - [ ] Have you ensured that the full suite of tests is executed via `mvn 
-Pcontrib-check clean install` at the root `nifi` folder?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [ ] Have you verified that the full build is successful on JDK 8?
   - [ ] Have you verified that the full build is successful on JDK 11?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] If applicable, have you updated the `LICENSE` file, including the main 
`LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main 
`NOTICE` file found under `nifi-assembly`?
   - [ ] If adding new Properties, have you added `.displayName` in addition to 
.name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which 
it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI for 
build issues and submit an update to your PR as soon as possible.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to