-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix(stats): improve stats app resiliency #385
fix(stats): improve stats app resiliency #385
Conversation
Hello @baktun14 would you check it? |
Hello @Redm4x @ygrishajev |
Hello @ygrishajev I just fixed |
Hello @ygrishajev How about 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.
height: latestBlocks && latestBlocks.length > 0 ? latestBlocks[0].height : undefined, | ||
transactionCount: latestBlocks && latestBlocks.length > 0 ? latestBlocks[0].totalTransactionCount : undefined, | ||
} | ||
const latestTransactions = await runOrLog(() => getTransactions(5)); |
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.
what do you think about one last improvement here? Promise.all should speed up this endpoint quite a bit
const [{ now, compare }, chainStatsQuery, networkCapacity, networkCapacityStats, latestBlocks, latestTransactions] = await Promise.all([
runOrLog(getDashboardData),
runOrLog(getChainStats, {
bondedTokens: undefined,
totalSupply: undefined,
communityPool: undefined,
inflation: undefined,
stakingAPR: undefined
}),
runOrLog(getNetworkCapacity),
runOrLog(() => getProviderGraphData("count")),
runOrLog(() => getBlocks(5)),
runOrLog(() => getTransactions(5))
]);
const chainStats = {
...chainStatsQuery,
height: latestBlocks && latestBlocks.length > 0 ? latestBlocks[0].height : undefined,
transactionCount: latestBlocks && latestBlocks.length > 0 ? latestBlocks[0].totalTransactionCount : undefined
};
ee40d6b
to
3707f0a
Compare
All things are finished @Redm4x cc: @ygrishajev |
We follow rebase strategy, can you squash the merge commit too pls? |
feat: add try catch for stats feat: improve stats app resiliency fix: remove try catch from api fix: avoid to confuse nodeService values fix: add error handling by logging and sentry fix: fix clean code fix: add runOrLog function fix: lint fix: chagne logger name fix: add error handling to node status fix: add logging util feat: improve speed to get stats feat: add scope
5997f85
to
16e96ef
Compare
How about now? @ygrishajev cc: @Redm4x |
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.
Lgtm! Thanks for all your changes!
ref #330