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

Function json

src/master/readonly_handler.cpp:440–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438
439
440void json(JSON::ObjectWriter* writer, const Summary<Framework>& summary)
441{
442 const Framework& framework = summary;
443
444 writer->field("id", framework.id().value());
445 writer->field("name", framework.info.name());
446
447 // Omit pid for http frameworks.
448 if (framework.pid().isSome()) {
449 writer->field("pid", string(framework.pid().get()));
450 }
451
452 // TODO(bmahler): Use these in the webui.
453 writer->field("used_resources", framework.totalUsedResources);
454 writer->field("offered_resources", framework.totalOfferedResources);
455 writer->field("capabilities", framework.info.capabilities());
456 writer->field("hostname", framework.info.hostname());
457 writer->field("webui_url", framework.info.webui_url());
458 writer->field("active", framework.active());
459 writer->field("connected", framework.connected());
460 writer->field("recovered", framework.recovered());
461}
462
463
464// This abstraction has no side-effects. It factors out computing the

Callers 6

operator()Method · 0.70
foreachvalueFunction · 0.70
stateMethod · 0.70
foreachpairFunction · 0.70
foreachvalueFunction · 0.50
toJSONMethod · 0.50

Calls 10

fieldMethod · 0.80
activeMethod · 0.80
recoveredMethod · 0.80
connectedMethod · 0.65
valueMethod · 0.45
idMethod · 0.45
nameMethod · 0.45
isSomeMethod · 0.45
pidMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected