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

Add transactions cache #2283

Merged
merged 1 commit into from
Jul 3, 2019
Merged

Add transactions cache #2283

merged 1 commit into from
Jul 3, 2019

Conversation

pasqu4le
Copy link
Contributor

@pasqu4le pasqu4le commented Jul 2, 2019

Closes #2250

Checklist for your PR

  • I added an entry to CHANGELOG.md with this PR
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • I checked whether I should update the docs and did so if necessary

@pasqu4le pasqu4le self-assigned this Jul 2, 2019
@pasqu4le pasqu4le added the ready for review This PR is ready for reviews. label Jul 2, 2019
@coveralls
Copy link

coveralls commented Jul 2, 2019

Pull Request Test Coverage Report for Build 3d7d7366-a31e-43db-bf88-045833e0f752

  • 42 of 46 (91.3%) changed or added relevant lines in 6 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage remained the same at 81.194%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/chain.ex 8 9 88.89%
apps/explorer/lib/explorer/chain/transactions_cache.ex 26 29 89.66%
Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/fetcher/replaced_transaction.ex 2 90.91%
apps/explorer/lib/explorer/market/market_history_cache.ex 3 83.33%
apps/indexer/lib/indexer/block/catchup/fetcher.ex 4 69.23%
Totals Coverage Status
Change from base Build 691b3646-ffc5-4c65-bfab-bfc24c7c58a5: 0.0%
Covered Lines: 5155
Relevant Lines: 6349

💛 - Coveralls

@@ -6,6 +6,13 @@ defmodule BlockScoutWeb.TransactionControllerTest do

alias Explorer.Chain.Transaction

setup do
Supervisor.terminate_child(Explorer.Supervisor, {ConCache, :transactions})
Copy link
Contributor

@ayrat555 ayrat555 Jul 2, 2019

Choose a reason for hiding this comment

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

can we add it to DataCase instead of adding to all test files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ayrat555 not really, being these BlockScoutWeb tests they don't use Explorer.DataCase.

However they use BlockScoutWeb.FeatureCase and BlockScoutWeb.ConnCase, so I put the restart in their setup and it seems to be working.

@pasqu4le pasqu4le force-pushed the pp-transactions-cache branch 2 times, most recently from 7d0ca90 to 2d25026 Compare July 2, 2019 13:13
Copy link
Contributor

@ayrat555 ayrat555 left a comment

Choose a reason for hiding this comment

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

one comment. lgtm

@vbaranov
Copy link
Member

vbaranov commented Jul 3, 2019

@pasqu4le dialyzer test failed

Problem: due to the unsatisfying performance of the main page some ETS-based cache has been deemed necessary.
In this particular case one for the most recent collated transactions.

Solution: implementation of said transactions cache
@vbaranov vbaranov merged commit f4088b0 into master Jul 3, 2019
@vbaranov vbaranov deleted the pp-transactions-cache branch July 3, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add caching of the 1st page of transactions list to ETS
4 participants