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

cmd, dashboard, ethdb, vendor: send iostats to dashboard #16277

Merged
merged 5 commits into from
Mar 8, 2018

Conversation

kurkomisi
Copy link
Contributor

Update the goleveldb vendor package.
Collect the effective amount of disk RW and send it to the dashboard.
Remove the old RW metrics.

Only the last commit is relevant, the previous ones are part of this PR #16263

func (db *LDBDatabase) meter(refresh time.Duration) {
// Create the counters to store current and previous values
counters := make([][]float64, 2)
for i := 0; i < 2; i++ {
counters[i] = make([]float64, 3)
}
// Create storage for iostats.
var curr, prev [2]float64
Copy link
Member

Choose a reason for hiding this comment

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

You only need to track the previous values, there's no point to pre-declare a curr array too. Also previously we only gathered compaction stats, so names like counters was good enough, since there wasn't ambiguity. With the added iostats, counters and curr and prev all of a sudden don't mean anything.

Please rename counters to compactions and curr/prev to iostats.

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

Minor ambiguity issue in the stats gathering, otherwise lgtm.

curr[0], _ = strconv.ParseFloat(strings.Split(parts[0], ":")[1], 64)
curr[1], _ = strconv.ParseFloat(strings.Split(parts[1], ":")[1], 64)
read, _ := strconv.ParseFloat(strings.Split(parts[0], ":")[1], 64)
write, _ := strconv.ParseFloat(strings.Split(parts[1], ":")[1], 64)
Copy link
Member

Choose a reason for hiding this comment

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

Please handle any error, otherwise this will blow up the stats.

db.log.Error("Read entry parsing failed", "err", err)
return
}
w := strings.Split(parts[1], ":")
Copy link
Member

Choose a reason for hiding this comment

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

This will panic if len(parts) == 1

return
}
w := strings.Split(parts[1], ":")
if len(r) < 1 {
Copy link
Member

Choose a reason for hiding this comment

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

r -> w

return
}
w := strings.Split(parts[1], ":")
if len(r) < 2 {
Copy link
Member

Choose a reason for hiding this comment

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

w

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe added this to the 1.8.3 milestone Mar 8, 2018
@karalabe karalabe merged commit 39c16c8 into ethereum:master Mar 8, 2018
prestonvanloon pushed a commit to prestonvanloon/go-ethereum that referenced this pull request Apr 2, 2018
* cmd, dashboard, ethdb, vendor: send iostats to dashboard

* ethdb: change names

* ethdb: handle parsing errors

* ethdb: handle iostats syntax error

* ethdb: r -> w
hackmod pushed a commit to OpenCommunityCoin/go-esn that referenced this pull request Jul 9, 2018
* cmd, dashboard, ethdb, vendor: send iostats to dashboard

* ethdb: change names

* ethdb: handle parsing errors

* ethdb: handle iostats syntax error

* ethdb: r -> w
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
* cmd, dashboard, ethdb, vendor: send iostats to dashboard

* ethdb: change names

* ethdb: handle parsing errors

* ethdb: handle iostats syntax error

* ethdb: r -> w
firmianavan pushed a commit to firmianavan/go-ethereum that referenced this pull request Aug 28, 2018
* cmd, dashboard, ethdb, vendor: send iostats to dashboard

* ethdb: change names

* ethdb: handle parsing errors

* ethdb: handle iostats syntax error

* ethdb: r -> w
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