Ejemplo n.º 1
0
parser.add_argument("-d",
                    "--dirs",
                    help="list of directories to aggregate",
                    nargs="+")

args = parser.parse_args()
stat_dir_exp = os.path.abspath(os.path.join(ROOT_DIR, args.stat))
sums_dir_exp = os.path.abspath(os.path.join(ROOT_DIR, args.sums))
co.check_directory_exists(sums_dir_exp)

##################################################
##                 GET THE DATA                 ##
##################################################

connections = cog.fetch_valid_data(stat_dir_exp, args)
multiflow_connections, singleflow_connections = cog.get_multiflow_connections(
    connections)

##################################################
##               PLOTTING RESULTS               ##
##################################################

INITIAL_SF = 'Initial SF'
INITIAL_SFS = '2 Initial SFs'
nb_conns = 0
nb_bytes = {co.C2S: 0, co.S2C: 0}

results = {
    co.C2S: {
        INITIAL_SF: [],
        INITIAL_SFS: []
    },
parser.add_argument('-S',
                    "--sums", help="directory where the summary graphs will be stored", default=co.DEF_SUMS_DIR + '_' + co.DEF_IFACE)
parser.add_argument("-d",
                    "--dirs", help="list of directories to aggregate", nargs="+")

args = parser.parse_args()
stat_dir_exp = os.path.abspath(os.path.join(ROOT_DIR, args.stat))
sums_dir_exp = os.path.abspath(os.path.join(ROOT_DIR, args.sums))
co.check_directory_exists(sums_dir_exp)

##################################################
##                 GET THE DATA                 ##
##################################################

connections = cog.fetch_valid_data(stat_dir_exp, args)
multiflow_connections, singleflow_connections = cog.get_multiflow_connections(connections)

##################################################
##               PLOTTING RESULTS               ##
##################################################

color = "orange"
base_graph_name = "example_graph"
graph_full_path = base_graph_name + ".pdf"

plt.figure()
plt.clf()
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 5, 6], color=color, linewidth=2, label="Example")

# Put a legend above current axis