-
Notifications
You must be signed in to change notification settings - Fork 324
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
Log summary about the node status #3870
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3870 +/- ##
==========================================
+ Coverage 75.38% 75.40% +0.02%
==========================================
Files 303 328 +25
Lines 25923 27806 +1883
==========================================
+ Hits 19541 20967 +1426
- Misses 5360 5767 +407
- Partials 1022 1072 +50
... and 9 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -156,6 +157,9 @@ type ( | |||
gasLimit uint64, | |||
data []byte, | |||
config *logger.Config) ([]byte, *action.Receipt, *logger.StructLogger, error) | |||
|
|||
// Track adds a track record for the given method | |||
Track(ctx context.Context, start time.Time, method string, size int64, success bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is an API added in the coreservice
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is passed through the Option
of newCoreService
. There is already coreService
in web3Handler
, we can use it directly.
) | ||
defer func(start time.Time) { svr.coreService.Track(ctx, start, method.(string), int64(size), err == nil) }(time.Now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do gRPC and HTTP servers not require invoking the Track
method?
pkg/nodestats/nodestats.go
Outdated
blocksync blocksync.BlockSync | ||
p2pAgent p2p.Agent | ||
task *routine.RecurringTask | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to move to a diff place (should be server\itx
) since the struct included blocksync
and p2p
@@ -42,7 +43,7 @@ type ( | |||
// BlockSync defines the interface of blocksyncer | |||
BlockSync interface { | |||
lifecycle.StartStopper | |||
|
|||
nodestats.StatsReporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this, don't need to explicitly tell, so we can remove the import at L26 above
@@ -98,6 +99,7 @@ type ( | |||
// Agent is the agent to help the blockchain node connect into the P2P networks and send/receive messages | |||
Agent interface { | |||
lifecycle.StartStopper | |||
nodestats.StatsReporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
Description
The node stats information will be printed to stdout every 5 minutes.
During indexer sync, stats report are not available
Fixes #3782Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: