You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/08/11 00:53:37 UTC
mesos git commit: Updated sorter benchmark to time unallocation and
agent removal.
Repository: mesos
Updated Branches:
refs/heads/master 7ec00915d -> 683551c92
Updated sorter benchmark to time unallocation and agent removal.
This patch is adding cleanup to the sorter:
1) Added time elapse for unallocated all resources for all clients.
2) Added time elapse for removing all agents.
3) Added time elapse for removing all clients.
Review: https://reviews.apache.org/r/50877/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/683551c9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/683551c9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/683551c9
Branch: refs/heads/master
Commit: 683551c927a8ab114792a056811650d10d2a3b32
Parents: 7ec0091
Author: Guangya Liu <gy...@gmail.com>
Authored: Wed Aug 10 17:51:37 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Wed Aug 10 17:53:32 2016 -0700
----------------------------------------------------------------------
src/tests/sorter_tests.cpp | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/683551c9/src/tests/sorter_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/sorter_tests.cpp b/src/tests/sorter_tests.cpp
index d6578c0..821e30d 100644
--- a/src/tests/sorter_tests.cpp
+++ b/src/tests/sorter_tests.cpp
@@ -684,6 +684,42 @@ TEST_P(Sorter_BENCHMARK_Test, FullSort)
cout << "No-op sort of " << clientCount << " clients took "
<< watch.elapsed() << endl;
+
+ watch.start();
+ {
+ // Unallocate resources on all agents, round-robin through the clients.
+ size_t clientIndex = 0;
+ foreach (const SlaveID& slaveId, agents) {
+ const string& client = clients[clientIndex++ % clients.size()];
+ sorter.unallocated(client, slaveId, allocated);
+ }
+ }
+ watch.stop();
+
+ cout << "Removed allocations for " << agentCount << " agents in "
+ << watch.elapsed() << endl;
+
+ watch.start();
+ {
+ foreach (const SlaveID& slaveId, agents) {
+ sorter.remove(slaveId, agentResources);
+ }
+ }
+ watch.stop();
+
+ cout << "Removed " << agentCount << " agents in "
+ << watch.elapsed() << endl;
+
+ watch.start();
+ {
+ foreach (const string& clientId, clients) {
+ sorter.remove(clientId);
+ }
+ }
+ watch.stop();
+
+ cout << "Removed " << clientCount << " clients in "
+ << watch.elapsed() << endl;
}
} // namespace tests {