Exemplo n.º 1
0
 def do_all(name, g, i, t, data):
     global options
     assert options
     filename = ''
     if 'metrics' in options.operations:
         stats, filename = metrics.do_metrics(options, name, g)
         filename = filename.replace('data_out', 'data_vis')
     else:
         controllers = metrics.get_controllers(g, options)
         exp_filename = metrics.get_filename(name, options, controllers)
         if not os.path.exists(exp_filename + '.json'):
             raise Exception("invalid file path: %s" % exp_filename)
         print("exp_filename")
         print(exp_filename)
         input_file = open(exp_filename + '.json', 'r')
         stats = json.load(input_file)
         filename = exp_filename.replace('data_out', 'data_vis')
     if 'cdfs' in options.operations:
         plot_cdfs.do_cdfs(options, stats, filename)
     if 'ranges' in options.operations:
         plot_ranges.do_ranges(options, stats, filename, 'os3e')
     if 'pareto' in options.operations:
         plot_pareto.do_pareto(options, stats, filename)
     if 'cloud' in options.operations:
         plot_cloud.do_cloud(options, stats, filename, 'png')
Exemplo n.º 2
0
def do_all(options, name, g, i, t, data):
    filename = ''
    if 'metrics' in options.operations:
        stats, filename = metrics.do_metrics(options, name, g)
        filename = filename.replace('data_out', 'data_vis')
    else:
        controllers = metrics.get_controllers(g, options)
        exp_filename = metrics.get_filename(name, options, controllers)
        if not os.path.exists(exp_filename + '.json'):
            raise Exception("invalid file path: %s" % exp_filename)
        input_file = open(exp_filename + '.json', 'r')
        stats = json.load(input_file)
        filename = exp_filename.replace('data_out', 'data_vis')
    if 'cdfs' in options.operations:
        plot_cdfs.do_cdfs(options, stats, filename)
    if 'ranges' in options.operations:
        plot_ranges.do_ranges(options, stats, filename)
    if 'pareto' in options.operations:
        plot_pareto.do_pareto(options, stats, filename)
    if 'cloud' in options.operations:
        plot_cloud.do_cloud(options, stats, filename, 'png')
Exemplo n.º 3
0
            # Check for --force here?
            print "usable topo: %s" % topo
            total_usable += 1
            controllers = metrics.get_controllers(g, options)
            exp_filename = metrics.get_filename(topo, options, controllers)

            path_exists = os.path.exists(exp_filename + '.json')
            compute_metrics = 'metrics' in options.operations

            # Compute data only when the following conditions hold:
            # - asked to complete metrics, AND
            # - asked to force, or data is missing
            if compute_metrics and (options.force or not path_exists):
                print "freshly analyzing topo: %s" % topo
                stats, filename = metrics.do_metrics(options, topo, g)
                filename = filename.replace('data_out', 'data_vis')
                total_used += 1
            # Otherwise, load the data:
            else:
                if not os.path.exists(exp_filename + '.json'):
                    if IGNORE_MISSING_DATA:
                        # Ignore, continue.
                        print "ignoring missing data in %s" % (exp_filename + '.json')
                        continue
                    else:
                        raise Exception("invalid file path: %s" % exp_filename)
                input_file = open(exp_filename + '.json', 'r')
                stats = json.load(input_file)
                total_used += 1
Exemplo n.º 4
0
 def do_all(name, g, i, t, data, mylist):
     global options
     assert options
     filename = ''
     stats, filename = metrics.do_metrics(options, name, g, mylist)
Exemplo n.º 5
0
    def do_all(name, g, i, t, data, mylist):
        global options
        assert options
        filename = ''
	stats, filename = metrics.do_metrics(options, name, g, mylist)