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

made epoch start metrics persistent and/or fetch from epoch bootstrapper #1872

Merged
merged 7 commits into from
Jun 8, 2020

Conversation

bogdan-rosianu
Copy link
Contributor

Made metrics related to nonce and round at epoch start persistent

@bogdan-rosianu bogdan-rosianu added the type:bug Something isn't working label Jun 5, 2020
@bogdan-rosianu bogdan-rosianu self-assigned this Jun 5, 2020
@LucianMincu LucianMincu changed the base branch from release-candidate to development June 5, 2020 10:19
SebastianMarian
SebastianMarian previously approved these changes Jun 5, 2020
@@ -863,6 +863,7 @@ func startNode(ctx *cli.Context, log logger.Logger, version string) error {
Rounder: rounder,
AddressPubkeyConverter: addressPubkeyConverter,
LatestStorageDataProvider: latestStorageDataProvider,
StatusHandler: coreComponents.StatusHandler,
Copy link
Contributor

Choose a reason for hiding this comment

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

please check if this is the correct instance. We have an issue regarding coreComponents.StatusHandler. It is instantiated twice (one mock, and then the "real" one). ⚔️

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 is ok. on main.go, line 738 we see a :
coreComponents.StatusHandler = statusHandlersInfo.StatusHandler
and the bootstrapper args are written on line 839

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the nil implementation of status handler is used when returning the Core Components but the value is filled after status handlers are created

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -88,6 +89,9 @@ func checkArguments(args ArgsEpochStartBootstrap) error {
if args.GeneralConfig.EpochStartConfig.MinNumConnectedPeersToStart < minNumConnectedPeers {
return fmt.Errorf("%s: %w", baseErrorMessage, epochStart.ErrNotEnoughNumConnectedPeers)
}
if check.IfNil(args.StatusHandler) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will hide errors, since we injected the status handler on the constructor. Suggestion to return error here and fix all integration tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also added nil checks when using the status handler inside bootstrapper, as it is only an additional component.

@@ -878,6 +881,11 @@ func (e *epochStartBootstrap) createRequestHandler() error {
return err
}

func (e *epochStartBootstrap) setEpochStartMetrics() {
e.statusHandler.SetUInt64Value(core.MetricNonceAtEpochStart, e.epochStartMeta.Nonce)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we also rewrite the metrics for erd_nonces_passed_in_current_epoch and erd_rounds_passed_in_current_epoch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, those are calculated when calling the API endpoint. So it is ok

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@iulianpascalau iulianpascalau changed the base branch from development to release-candidate June 5, 2020 13:25
@iulianpascalau iulianpascalau dismissed SebastianMarian’s stale review June 5, 2020 13:25

The base branch was changed.

@@ -891,8 +892,10 @@ func (e *epochStartBootstrap) createRequestHandler() error {
}

func (e *epochStartBootstrap) setEpochStartMetrics() {
e.statusHandler.SetUInt64Value(core.MetricNonceAtEpochStart, e.epochStartMeta.Nonce)
e.statusHandler.SetUInt64Value(core.MetricRoundAtEpochStart, e.epochStartMeta.Round)
if !check.IfNil(e.statusHandler) && e.epochStartMeta != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need the check !check.IfNil(e.statusHandler) ?

iulianpascalau
iulianpascalau previously approved these changes Jun 5, 2020
SebastianMarian
SebastianMarian previously approved these changes Jun 5, 2020
@iulianpascalau iulianpascalau dismissed stale reviews from SebastianMarian and themself via d938d58 June 5, 2020 18:36
iulianpascalau
iulianpascalau previously approved these changes Jun 5, 2020
SebastianMarian
SebastianMarian previously approved these changes Jun 6, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit cdba991 into release-candidate Jun 8, 2020
@LucianMincu LucianMincu deleted the persistent-epoch-start-metrics branch June 8, 2020 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants