MCPcopy Create free account
hub / github.com/apache/mesos / TEST_F

Function TEST_F

src/tests/hierarchical_allocator_benchmarks.cpp:328–487  ·  view source on GitHub ↗

This benchmark launches frameworks with different profiles (number of tasks, task sizes and etc.) and prints out statistics such as total tasks launched, cluster utilization and allocation latency. The test has a timeout of 30 seconds.

Source from the content-addressed store, hash-verified

326// cluster utilization and allocation latency. The test has a timeout of 30
327// seconds.
328TEST_F(BENCHMARK_HierarchicalAllocations, MultiFrameworkAllocations)
329{
330 // Pause the clock because we want to manually drive the allocations.
331 Clock::pause();
332
333 BenchmarkConfig config;
334
335 // Add agent profiles.
336 config.agentProfiles.push_back(AgentProfile(
337 "agent",
338 80,
339 CHECK_NOTERROR(Resources::parse("cpus:64;mem:488000"))));
340
341 // Add framework profiles.
342
343 // A profile to simulate frameworks that launch thousands of smaller apps.
344 // It is similar in behavior to some meta-frameworks such as Marathon. This
345 // also limits max tasks per offer to 100 to spread the load more uniformly
346 // over allocation cycles.
347 for (size_t i = 0; i < 4; i++) {
348 config.frameworkProfiles.push_back(FrameworkProfile(
349 "Marathon-" + stringify(i + 1),
350 {"roleA-" + stringify(i + 1)},
351 1,
352 4000,
353 CHECK_NOTERROR(Resources::parse("cpus:0.07;mem:400;")),
354 100));
355 }
356
357 // A profile to simulate workloads where a large number of frameworks launch a
358 // handful of tasks. E.g., a large number of Jenkins masters which are trying
359 // to launch some build jobs. We enforce a task-per-offer limit of 1.
360 config.frameworkProfiles.push_back(FrameworkProfile(
361 "Jenkins",
362 {"roleB"},
363 500,
364 5,
365 CHECK_NOTERROR(Resources::parse("cpus:0.1;mem:4000;")),
366 1));
367
368 // A profile to simulate workloads where frameworks launch larger jobs that
369 // are similar in spirit to Spark dispatcher/driver model. We enforce a
370 // task-per-offer limit of 5.
371 for (size_t i = 0; i < 50; i++) {
372 config.frameworkProfiles.push_back(FrameworkProfile(
373 "SparkDispatcher-" + stringify(i + 1),
374 {"roleC-" + stringify(i + 1)},
375 1,
376 20,
377 CHECK_NOTERROR(Resources::parse("cpus:1;mem:1000;")),
378 5));
379 }
380
381 initializeCluster(config);
382
383 // Now perform allocations. We continue until either we timeout or we have
384 // launched all of the expected tasks.
385 const Duration TEST_TIMEOUT = Seconds(30);

Callers

nothing calls this directly

Calls 15

AgentProfileClass · 0.85
FrameworkProfileClass · 0.85
SecondsClass · 0.85
NoneClass · 0.85
elapsedMethod · 0.80
isReadyMethod · 0.80
startMethod · 0.65
stopMethod · 0.65
parseFunction · 0.50
stringifyFunction · 0.50
getMethod · 0.45
unallocateMethod · 0.45

Tested by

no test coverage detected