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

Function createTaskInfo

src/tests/master_benchmarks.cpp:107–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105
106
107static TaskInfo createTaskInfo(const SlaveID& slaveId)
108{
109 // Using a static local variable to avoid the cost of re-parsing.
110 static const Resources resources = Resources::parse("cpus:0.1;mem:5").get();
111
112 TaskInfo taskInfo = createTask(
113 slaveId,
114 resources,
115 "dummy command");
116
117 Labels* labels = taskInfo.mutable_labels();
118
119 for (size_t i = 0; i < 10; i++) {
120 const string index = stringify(i);
121 *(labels->add_labels()) =
122 protobuf::createLabel("key" + index, "value" + index);
123 }
124
125 return taskInfo;
126}
127
128
129// A fake agent currently just for testing reregisterations.

Callers 1

initializeMethod · 0.85

Calls 5

createLabelFunction · 0.85
createTaskFunction · 0.70
parseFunction · 0.50
stringifyFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected