-
Notifications
You must be signed in to change notification settings - Fork 968
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
Conversation
@syndtr PTAL :) |
f654e8a
to
d0ef418
Compare
d0ef418
to
e1013ad
Compare
leveldb/db.go
Outdated
@@ -51,6 +51,7 @@ type DB struct { | |||
|
|||
// Stats. | |||
aliveSnaps, aliveIters int32 | |||
writeDelayStat *wDelayStat |
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.
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
.
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.
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
.
@syndtr Updated! |
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
Merged at 34011bf. Thanks! |
Implements #181