% import json
% import urllib
% from webui_lib import *
% url = "http://localhost:" + slave_port + "/slave/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