Exemplo n.º 1
0
def WarmGraph(datadir, site):
    """Return a loading model graph for the warm pull of site.

  Based on ./analyze.py fetch file name conventions.

  Args:
    datadir: the directory containing site JSON data.
    site: a site string.

  Returns:
    A loading model object.
  """
    return loading_model.ResourceGraph(
        log_parser.FilterRequests(
            log_parser.ParseJsonFile(os.path.join(datadir, site + '.json'))))
def main():
    filename = sys.argv[1]
    requests = log_parser.ParseJsonFile(filename)
    requests = log_parser.FilterRequests(requests)
    (resources, deps) = _BuildResourceDependencyGraph(requests)
    _GraphvizFileFromDeps(resources, requests, deps, filename + '.dot')
Exemplo n.º 3
0
def _ProcessJson(json_data):
  assert json_data
  return loading_model.ResourceGraph(log_parser.FilterRequests(
      [log_parser.RequestData.FromDict(r) for r in json_data]))
Exemplo n.º 4
0
def _ProcessRequests(filename):
  requests = log_parser.FilterRequests(log_parser.ParseJsonFile(filename))
  return loading_model.ResourceGraph(requests)