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

chore: exposed a GRPC Service (endpoint) for the ServerStatus API #812

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

HarshSawarkar
Copy link

@HarshSawarkar HarshSawarkar commented Mar 10, 2025

Reviewer Notes

  • Added the PbjServerStatusServiceProxy to expose server status api endpoint.
  • Added the unit test to test the functionality and get code coverage.

Related Issue(s)

Fixes #777

Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

first pass, I know is still in draft.

In General is missing a lot of Javadocs.

@@ -1,4 +1,4 @@
#·SPDX-License-Identifier:·Apache-2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like IDE style changes that should not be commited.

@@ -63,6 +66,7 @@ public BlockNodeApp(
this.pbjBlockStreamService = requireNonNull(pbjBlockStreamService);
this.pbjBlockAccessService = requireNonNull(pbjBlockAccessService);
this.webServerBuilder = requireNonNull(webServerBuilder);
this.pbjServerStatusService = pbjServerStatusService;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this.pbjServerStatusService = pbjServerStatusService;
this.pbjServerStatusService = Objects.requireNonNull(pbjServerStatusService);

Comment on lines 12 to 31
public interface PbjServerStatusService extends ServiceInterface {
enum ServerStatusMethod implements Method {
serverStatus
}

@NonNull
default String serviceName() {
return SERVICE_NAME_BLOCK_NODE;
}

@NonNull
default String fullName() {
return FULL_SERVICE_NAME_BLOCK_NODE;
}

@NonNull
default List<Method> methods() {
return Arrays.asList(PbjServerStatusService.ServerStatusMethod.values());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing javadocs

Copy link
Author

Choose a reason for hiding this comment

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

Added

Comment on lines 41 to 43
this.serviceStatus = serviceStatus;
this.blockReader = blockReader;
this.metricsService = metricsService;
Copy link
Contributor

Choose a reason for hiding this comment

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

missing preConditions

Copy link
Author

Choose a reason for hiding this comment

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

Updated


private final ServiceStatus serviceStatus;
private final BlockReader<BlockUnparsed> blockReader;
private final MetricsService metricsService;
Copy link
Contributor

Choose a reason for hiding this comment

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

are we using the metrics?

We should be observing the amount of request we get, and if there were errors.

Copy link
Author

Choose a reason for hiding this comment

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

Added usage.

Comment on lines +61 to +62
() -> getBlockAsFileBlockStreamManager(
getAbsoluteFolder("build/resources/test//BlockAsDirException/1/")));
Copy link
Contributor

Choose a reason for hiding this comment

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

needed change?

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.

GRPC Service
2 participants