-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 latency numbers to increment tool #3422
Conversation
ce22694
to
633140c
Compare
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.
Get another approval before you merge. LGTM
Sample output
|
Add query, mutation and total txn latency numbers to increment tool. Set `CommitNow` to be true in mutation.
633140c
to
b894fec
Compare
|
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.
0515 12:54:04.699 Counter VAL: 95 [ Ts: 10181 ] [ 16ms 14ms 30ms ]
Total: 312ms
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @animesh2049 and @manishrjain)
Output after changing format.
|
25c70c6
to
f963386
Compare
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.
Got a few comments. Address those, get @mangalaman93 to review it again and merge it.
Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @animesh2049)
dgraph/cmd/counter/increment.go, line 67 at r3 (raw file):
Val int `json:"val"` startTs uint64 // Only used for internal testing.
query time.Duration
mutation time.Duration
dgraph/cmd/counter/increment.go, line 100 at r3 (raw file):
} func process(dg *dgo.Dgraph, conf *viper.Viper) (Counter, uint64, uint64, error) {
Instead of returning 4 results, you could add the latency numbers to Counter struct as private vars.
dgraph/cmd/counter/increment.go, line 181 at r3 (raw file):
} fmt.Printf("%-17s Counter VAL: %d [ Ts: %d ][ ", now, cnt.Val, cnt.startTs) fmt.Println(time.Duration(qLatency).Truncate(time.Millisecond)*time.Nanosecond,
I'm not sure about the point of doing *time.Nanosecond
. That is unnecessary.
Also, instead of using duration.Truncate, use duration.Round everywhere.
The final number should be the sum of query and mutation latency, technically speaking.
f963386
to
7ba4283
Compare
Query, Mutation, Total latency are now printed in single line.They are space separated and are in same order as mentioned here.
7ba4283
to
ca59e91
Compare
Results after further modifications
|
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.
Made some changes. Merging it now.
Reviewable status: 0 of 1 files reviewed, 6 unresolved discussions (waiting on @animesh2049 and @manishrjain)
Add query, mutation and server-side, client-side and difference between the two txn latency numbers to increment tool. Set CommitNow to be true in mutation.
Add query, mutation and total txn latency numbers to increment tool.
Set
CommitNow
to be true in mutation.This change is