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

simulator: add statistics for simulator #1218

Merged
merged 3 commits into from
Aug 31, 2018
Merged

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Aug 28, 2018

What have you changed? (required)

This PR add some statistics for simulator, such as task statistics and snapshot statistics.

What are the type of the changes (required)?

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested (required)?

  • Manual tests

@@ -179,6 +180,16 @@ func (t *transferLeader) Step(r *RaftEngine) {
t.finished = true
r.SetRegion(region)
r.recordRegionChange(region)
fromPeerID := t.fromPeer.GetId()
toPeerID := t.peer.GetId()
_, ok := r.schedulerStats.taskStats.transferLeader[fromPeerID]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we let the Stats just Observe the task and the statistical behavior is handled in observe

@@ -174,6 +174,7 @@ EXIT:
}

fmt.Printf("%s [%s] total iteration: %d, time cost: %v\n", simResult, confName, driver.TickCount(), time.Since(start))
driver.Print()
Copy link
Contributor

Choose a reason for hiding this comment

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

How about PrintStatistics ?

@disksing
Copy link
Contributor

Could you post some output example?

@rleungx
Copy link
Member Author

rleungx commented Aug 29, 2018

@disksing Here is an example of the add-nodes case:

OK [add-nodes] total iteration: 317, time cost: 33.814974228s
Remove Peer (task) 1482
Add Learner (task) 1497
Promote Learner (task) 1495
Transfer Leader (task) 514
Merge Region (task) 0
Add Peer (task) 0
Send Maximum (snapshot) 1180
Receive Maximum (snapshot) 750
Send Minimum (snapshot) 347
Receive Minimum (snapshot) 2

@nolouch nolouch merged commit bae4b59 into tikv:master Aug 31, 2018
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.

3 participants