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

leveldb: add write delay statistic #193

Closed
wants to merge 2 commits into from

Conversation

rjl493456442
Copy link
Contributor

Implements #181

@rjl493456442
Copy link
Contributor Author

@syndtr PTAL :)

@rjl493456442 rjl493456442 changed the title leveldb: add slow downed and paused write statistic leveldb: add write delay statistic Dec 13, 2017
leveldb/db.go Outdated
@@ -51,6 +51,7 @@ type DB struct {

// Stats.
aliveSnaps, aliveIters int32
writeDelayStat *wDelayStat
Copy link
Owner

Choose a reason for hiding this comment

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

I think we can just unpack wDelayStat struct into DB struct. Also I think using sync/atomic is enough (yes, inconsistency between counter and timer might happen but I think that's not a big issue in this case), you can cast time.Duration to int64.

Copy link
Owner

@syndtr syndtr left a comment

Choose a reason for hiding this comment

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

I think we can just unpack wDelayStat struct into DB struct. Also I think using sync/atomic is enough (yes, inconsistency between counter and timer might happen but I think that's not a big issue in this case), you can cast time.Duration to int64.

@rjl493456442
Copy link
Contributor Author

@syndtr Updated!

syndtr added a commit that referenced this pull request Dec 14, 2017
Merge #193, resolve #181.

Squashed commit of the following:

commit ba80ecc36712f250c44b6c6b0a6f70702fa2f6b0
Author: Suryandaru Triandana <[email protected]>
Date:   Thu Dec 14 19:06:05 2017 +0700

    leveld: fix some formatting and make sure 64-bit 'atomic' fields are 64-bit aligned

commit 9d05f5b
Author: rjl493456442 <[email protected]>
Date:   Wed Dec 13 16:27:37 2017 +0800

    leveldb: unpack cwriteDelay struct to db

commit e1013ad
Author: rjl493456442 <[email protected]>
Date:   Wed Dec 13 13:34:38 2017 +0800

    leveldb: add api for write delay query
@syndtr
Copy link
Owner

syndtr commented Dec 14, 2017

Merged at 34011bf. Thanks!

@syndtr syndtr closed this Dec 14, 2017
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