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/07/28 23:00:33 UTC

mesos git commit: Added number of filtered offers to allocator benchmark output.

Repository: mesos
Updated Branches:
  refs/heads/master bf5b0b252 -> 219158e28


Added number of filtered offers to allocator benchmark output.

This fix added number of filtered offers to two similar benchmarks:
  (1) HierarchicalAllocator_BENCHMARK_Test.ResourceLabels
  (2) HierarchicalAllocator_BENCHMARK_Test.DeclineOffers

This provides the reader which knowledge of how many filters are
active and how it impacts performance.

Review: https://reviews.apache.org/r/50382/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/219158e2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/219158e2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/219158e2

Branch: refs/heads/master
Commit: 219158e28fa8b4610a58a52dd55cb1272e9b4a83
Parents: bf5b0b2
Author: Guangya Liu <gy...@gmail.com>
Authored: Thu Jul 28 15:56:13 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu Jul 28 16:00:28 2016 -0700

----------------------------------------------------------------------
 src/tests/hierarchical_allocator_tests.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/219158e2/src/tests/hierarchical_allocator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp
index 33f5a42..acea127 100644
--- a/src/tests/hierarchical_allocator_tests.cpp
+++ b/src/tests/hierarchical_allocator_tests.cpp
@@ -3534,6 +3534,8 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, DeclineOffers)
   cout << "Added " << slaveCount << " agents in "
        << watch.elapsed() << endl;
 
+  size_t declinedOfferCount = 0;
+
   // Loop enough times for all the frameworks to get offered all the resources.
   for (size_t i = 0; i < frameworkCount * 2; i++) {
     // Permanently decline any offered resources.
@@ -3545,6 +3547,8 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, DeclineOffers)
           offer.frameworkId, offer.slaveId, offer.resources, filters);
     }
 
+    declinedOfferCount += offers.size();
+
     // Wait for the declined offers.
     Clock::settle();
     offers.clear();
@@ -3560,7 +3564,7 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, DeclineOffers)
     cout << "round " << i
          << " allocate() took " << watch.elapsed()
          << " to make " << offers.size() << " offers"
-         << endl;
+         << " after filtering  " << declinedOfferCount << " offers" << endl;
   }
 
   Clock::resume();
@@ -3714,6 +3718,8 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, ResourceLabels)
   cout << "Added " << slaveCount << " agents in "
        << watch.elapsed() << endl;
 
+  size_t declinedOfferCount = 0;
+
   // Loop enough times for all the frameworks to get offered all the resources.
   for (size_t i = 0; i < frameworkCount * 2; i++) {
     // Permanently decline any offered resources.
@@ -3725,6 +3731,8 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, ResourceLabels)
           offer.frameworkId, offer.slaveId, offer.resources, filters);
     }
 
+    declinedOfferCount += offers.size();
+
     // Wait for the declined offers.
     Clock::settle();
     offers.clear();
@@ -3740,7 +3748,7 @@ TEST_P(HierarchicalAllocator_BENCHMARK_Test, ResourceLabels)
     cout << "round " << i
          << " allocate() took " << watch.elapsed()
          << " to make " << offers.size() << " offers"
-         << endl;
+         << " after filtering " << declinedOfferCount << " offers" << endl;
   }
 
   Clock::resume();