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

OG-570 Server readiness stats #666

Merged
merged 12 commits into from
Jul 27, 2021
Merged

OG-570 Server readiness stats #666

merged 12 commits into from
Jul 27, 2021

Conversation

shahafn
Copy link
Member

@shahafn shahafn commented Jul 23, 2021

Message format:

curl https://matic1-220.relays.opengsn.org/gsn1/getaddr; echo
{"relayWorkerAddress":"0xe499a644e0fcdc7353f6c329d6821a1a1c89fe96","relayManagerAddress":"0x555bbf8d0289e48e9aeb7603d45829c6349920c8","relayHubAddress":"0x6C28AfC105e65782D9Ea6F2cA68df84C9e7d750d","ownerAddress":"0x8C1FD2DE219c98f5F88620422e36a8A32f83324E","minGasPrice":"1010000000","maxAcceptanceBudget":"285252","chainId":"137","networkId":"137","ready":false,"version":"2.2.3-matic"}
curl https://matic1-220.relays.opengsn.org/gsn1/stats; echo
{"runningSince":1627002112471,"currentStateTimestamp":1627002112471,"totalReadyTime":0,"totalNotReadyTime":978871,"totalReadinessChanges":0,"totalUptime":978871}

@shahafn shahafn changed the title Server stats OG-570 Server readiness stats Jul 23, 2021
@drortirosh
Copy link
Member

you have "Curernt state time", but not the actual current state..
also, "last error" would also be useful.

try {
const statsResponse = this.relayService.statsHandler()
res.send(statsResponse)
console.log('stats sent.')
Copy link
Member

Choose a reason for hiding this comment

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

logger.debug

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -40,7 +40,8 @@ contract('PenalizerService', function (accounts) {
url: '',
workdir: '',
etherscanApiUrl: 'etherscanApiUrl',
relayHubAddress: env.relayHub.address
relayHubAddress: env.relayHub.address,
Copy link
Member

Choose a reason for hiding this comment

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

yes, its required... how did the test pass without it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was given default owner (zero address), which is now no longer allowed. This is from previous PR #665

statsHandler (): StatsResponse {
const now = Date.now()
const statsResponse: StatsResponse = { ...this.readinessInfo, totalUptime: now - this.readinessInfo.runningSince }
if (this.isReady()) {
Copy link
Member

Choose a reason for hiding this comment

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

took me a while to understand: you update here the partial state, since last state change... maybe we can put a comment.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@shahafn shahafn merged commit 7f716d8 into master Jul 27, 2021
@shahafn shahafn deleted the server-stats branch July 27, 2021 11:10
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