% import json % import urllib % from webui_lib import * % url = "http://localhost:" + slave_port + "/" + slave_id + "/state.json" % data = urllib.urlopen(url).read() % state = json.loads(data) Framework {{framework_id}}

Framework {{framework_id}}

% # Find the framework with the given ID. % framework = None % for i in range(len(state['frameworks'])): % if state['frameworks'][i]['id'] == framework_id: % framework = state['frameworks'][i] % end % end % if framework != None: % # Count the number of tasks and sum the resources. % tasks = 0 % cpus = 0 % mem = 0 % for executor in framework['executors']: % for task in executor['tasks']: % cpus += task['resources']['cpus'] % mem += task['resources']['mem'] % tasks += 1 % end % end

Name: {{framework['name']}}
Running Tasks: {{tasks}}
CPUs: {{cpus}}
MEM: {{format_mem(mem)}}

Executors

% if len(framework['executors']) > 0: % for executor in framework['executors']: % tasks = 0 % cpus = 0 % mem = 0 % for task in executor['tasks']: % cpus += task['resources']['cpus'] % mem += task['resources']['mem'] % tasks += 1 % end % end
ID Tasks CPUs MEM Logs
{{executor['id']}} {{tasks}} {{cpus}} {{mem}} [stdout] [stderr]
% else:

No executors for this framework are active on this slave.

% end % else:

No framework with ID {{framework_id}} is active on this slave.

% end

Back to Slave