Skip to content

internal/ethapi: fix debug.chaindbProperty #19856

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

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

karalabe
Copy link
Member

A while back we've switched ethdb.Database from a LevelDB backed struct to an interface. Some code was accidentally left in that still assumed the old structs/methods. This PR fixes on such instance where the debug.chaindbProperty got borked:

> debug.chaindbProperty("leveldb.stats")
WARN [07-18|16:08:30.756] Served debug_chaindbProperty             reqid=9 t=116.452µs err="chaindbProperty does not work for memory databases"
Error: chaindbProperty does not work for memory databases
    at web3.js:3143:20
    at web3.js:6347:15
    at web3.js:5081:36
    at <anonymous>:1:1

vs. this PR

> debug.chaindbProperty("leveldb.stats")
Compactions
 Level |   Tables   |    Size(MB)   |    Time(sec)  |    Read(MB)   |   Write(MB)
-------+------------+---------------+---------------+---------------+---------------
   0   |          2 |      53.29891 |       0.00000 |       0.00000 |       0.00000
   1   |         42 |      84.86589 |       0.00000 |       0.00000 |       0.00000
   2   |        567 |     954.72873 |       0.00000 |       0.00000 |       0.00000
   3   |       5112 |    9858.93917 |       0.00000 |       0.00000 |       0.00000
   4   |       2906 |    5625.94529 |       0.00000 |       0.00000 |       0.00000
-------+------------+---------------+---------------+---------------+---------------
 Total |       8629 |   16577.77798 |       0.00000 |       0.00000 |       0.00000

@karalabe karalabe added this to the 1.9.1 milestone Jul 18, 2019
@karalabe karalabe merged commit e8c9579 into ethereum:master Jul 18, 2019
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.

1 participant