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

Feature/2634/simple html node monitor #3000

Merged

Conversation

bsc7
Copy link
Contributor

@bsc7 bsc7 commented Nov 13, 2024

NodeMonitor: FE: +ReportDiffs, +NodeType/UserName

  • ReportDiffs: Compares reports and highlights deviations based on thresholds.
  • NodeType/UserName: Displays node type and username alongside the address.
  • Unified BE/FE naming conventions and API endpoints for consistency.

ReportDiffs enables comparison across all reports and provides average values. It supports three configurable thresholds, which can be adjusted in the settings. Threshold violations are visually highlighted, hover shows the specific average value and the amount by which it was exceeded. For subtables, the background of the button that toggles the detail view is marked based on the highest exceeded threshold.

Origin: #2634, Previous PR: #2978

@bsc7
Copy link
Contributor Author

bsc7 commented Nov 14, 2024

Bildschirmfoto vom 2024-11-13 15-12-50
Bildschirmfoto vom 2024-11-13 15-13-30

@HenrikJannsen
Copy link
Contributor

Looks great!

Could we change the algorithm for coloring for certain fields?

  • Num Connections: Don't apply color if >10. Nodes can configure target number but should be min. 12
  • Memory Used: Don't apply if < 500
  • Num Threads: Don't apply if < 70
  • Node Load: Don't apply if < 0.4

Let me know if you can do that in this PR or prefer a new one.

@bsc7
Copy link
Contributor Author

bsc7 commented Nov 15, 2024

I'll take care of it in this PR; it shouldn't be a big deal. I just don't know if I'll get around to it in the next few days.

* Rebase/Merge completed due to REST API reorg
* ReportDiffs: Compares reports and highlights deviations based on thresholds.
* NodeType/UserName: Displays node type and username alongside the address.
* Unified BE/FE naming conventions and API endpoints for consistency.

---
ReportDiffs enables comparison across all reports and provides average
values. It supports three configurable thresholds, which can be adjusted
in the settings. Threshold violations are visually highlighted: for
subtables, the background of the button that toggles the detail view
is marked based on the highest exceeded threshold.
@bsc7 bsc7 force-pushed the feature/2634/Simple_HTML_NodeMonitor branch 2 times, most recently from a26d4e5 to e5d4099 Compare November 18, 2024 19:07
@bsc7
Copy link
Contributor Author

bsc7 commented Nov 18, 2024

Branch rebased onto new main. Conflicts have been resolved.


Bildschirmfoto vom 2024-11-18 18-30-03

Copy link
Contributor

@HenrikJannsen HenrikJannsen left a comment

Choose a reason for hiding this comment

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

See comment for AddressDetails. Beside that it looks good!

@@ -1,5 +1,6 @@
plugins {
id("bisq.java-library")
id("bisq.protobuf")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is that needed? We don't have protobuf files here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah saw now you added a protobuf file for AddressDetails.

What is the intention? We use protobuf only or p2p network communication. Here it seems it is just a dto for the response. If so, I would suggest to remove the protobuf part and move the file into report package.

Copy link
Contributor Author

@bsc7 bsc7 Nov 19, 2024

Choose a reason for hiding this comment

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

Ah, okay. I wasn't aware that Protobufs are primarily for P2P communication. I added them because you mentioned we should avoid using DTOs as much as possible. Since I needed one, and Protobufs seemed like the "state of the art" solution to me as a beginner, I implemented it that way.

But regarding the solution:

I would suggest to remove the protobuf part ...

You mean I should remove the line id("bisq.protobuf") from build.gradle.kts, which means Protobuf won't be generated, and as a result, AddressDetails would need to be converted to AddressDetailsDto.
Or should Protobuf still be used? If so, I'm not very familiar with the build process: where exactly should I then define the usage of Protobuf(id("bisq.protobuf"))?

I would suggest to ... move the file into report package.

You mean placing the transport class (whether Protobuf or DTO) alongside ReportRestApi, or using a separate package for transport classes alongside ReportRestApi? I find the latter option more elegant.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes the id("bisq.protobuf") from gradle and rest_api.proto file can be removed as well as the implements NetworkProto and the 3 PB related methods in the AddressDetails class. The void verify() can be kept if you like, but its also mainly for network data to protect against ddos.
And move that class to bisq.rest_api.report.

}

@Override
public bisq.rest_api.protobuf.AddressDetails toProto(boolean serializeForHash) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Best to use import to avoid the long name space.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would result in a name collision since the classes have the same name, which makes the import impossible. Unless, of course, I misunderstood what you meant. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I just tried on your branch with import bisq.rest_api.proto.AddressDetails; and it worked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the truth lies somewhere in the middle :))

Copy link
Contributor

@HenrikJannsen HenrikJannsen left a comment

Choose a reason for hiding this comment

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

utACK

@HenrikJannsen HenrikJannsen merged commit 28119b2 into bisq-network:main Nov 19, 2024
15 checks passed
@bsc7 bsc7 deleted the feature/2634/Simple_HTML_NodeMonitor branch November 19, 2024 12:55
@HenrikJannsen HenrikJannsen added this to the 2.1.3 milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants