Exemplo n.º 1
0
    import os

    logging.config.fileConfig('/home/thiago/YAFS/src/examples/Tutorial/logging.ini')

    start_time = time.time()
    # duracao a simulacao
    simulated_time = 100
    main(simulated_time=simulated_time)

    print("\n--- %s seconds ---" % (time.time() - start_time))

    ### Finally, you can analyse the results:
    print "-"*20
    print "Results:"
    print "-" * 20
    m = Stats(defaultPath="Results") #Same name of the results
    time_loops = [["M.Cam1","M.MLT", "M.FLT"]]
    # TODO: COLOCAR AS OUTRAS MENSAGENS EM time_loops
    m.showResults2(simulated_time, time_loops=time_loops)
    m.df["date"] = m.df.time_in.astype('datetime64[s]')
    m.df.index = m.df.date

    print "Media da latencia a cada 10 segundos"
    print m.df.resample('10s').agg(dict(time_latency='mean'))
    print "\t- Network saturation -"
    print "\t\tAverage waiting messages : %i" % m.average_messages_not_transmitted()
    print "\t\tPeak of waiting messages : %i" % m.peak_messages_not_transmitted()
    print "\t\tTOTAL messages not transmitted: %i" % m.messages_not_transmitted()

    # print "\n\t- Stats of each service deployed -"
    # print m.get_df_modules()
Exemplo n.º 2
0
    'module': False,
    'time': 9700
}, {
    'id': 56,
    'module': False,
    'time': 9800
}, {
    'id': 290,
    'module': False,
    'time': 9900
}]
print "Number of nodes removed: ", len(failures)

# Basic analysis
time_loops = [["M.Action"]]
s = Stats(defaultPath=path + "Results_%s_exp" % (size))
s.showResults2(size, time_loops=time_loops)

# Visualization of latency time series:

dfail = pd.DataFrame.from_dict(failures)
dfail["date"] = dfail.time.astype('datetime64[s]')
dfail.index = dfail.date
dfail['module'] = dfail.module.astype(str)
dfail = dfail.resample('10s').agg(
    {"module": "-".join})  #OPTIONAL BE CAREFOUL: resampling -> agg events
#dict(module=''))['module'].apply(list)

df = s.df
dfl = s.df_link
Exemplo n.º 3
0
Arquivo: main2.py Projeto: SiNa88/YAFS
if __name__ == '__main__':
    import logging.config
    import os

    logging.config.fileConfig(os.getcwd() + '/logging.ini')

    start_time = time.time()
    main(simulated_time=1000)

    print("\n--- %s seconds ---" % (time.time() - start_time))

    ### Finally, you can analyse the results:
    print "-" * 20
    print "Results:"
    print "-" * 20
    m = Stats(defaultPath="Results_multiple")  #Same name of the results
    time_loops = [["M.A", "M.B"]]
    m.showResults2(1000, time_loops=time_loops)
    print "\t- Network saturation -"
    print "\t\tAverage waiting messages : %i" % m.average_messages_not_transmitted(
    )
    print "\t\tPeak of waiting messages : %i" % m.peak_messages_not_transmitted(
    )
    print "\t\tTOTAL messages not transmitted: %i" % m.messages_not_transmitted(
    )

    print "\n\t- Stats of each service deployed -"
    print m.get_df_modules()
    print m.get_df_service_utilization("ServiceA", 1000)

    print "\n\t- Stats of each DEVICE -"
Exemplo n.º 4
0
time_loops = [["M.EGG", "M.Sensor", "M.Concentration"]]


#### ANALYSE FILES YAFS

police = "cloud"
police = "edge"

# print depth
# for idx1, depth in enumerate([4, 8, 12, 16]):
for idx1, depth in enumerate([2]):
    # 1000, 10000,
    for idx2,size in enumerate([1000,10000,100000]):
    #     size = 100000
        print "DEPTH: %i | TIME: %s" %(depth , size)
        s = Stats(defaultPath="Results_%s_%s_%s"%(police,size,depth))
        
        #Network
        s.showResults2(size, time_loops=time_loops)

        print "\t Bytes transmitted: " ,s.bytes_transmitted()
        print "\t Messages transmitted: ",s.count_messages()

        print "\t- Network saturation -"
        print "\t\tAverage waiting messages : %i" % s.average_messages_not_transmitted()
        print "\t\tPeak of waiting messages : %i" % s.peak_messages_not_transmitted()
        print "\t\tTOTAL messages not transmitted: %i" % s.messages_not_transmitted()

        #LOOPS
        # res = s.showLoops(time_loops)
        # loopstime[depth][idx2]=res[0]
Exemplo n.º 5
0
from pandas import Series, date_range
from matplotlib.ticker import FormatStrFormatter
# for size in [100,1000,10000,100000,1000000]:
time_loops = [["M.Action"]]

#### ANALYSE FILES YAFS

app1 = "app1"
app2 = "app2"

size = 12000

path = "examples/DynamicAllocation/"

#s = Stats(defaultPath=path+"Results_%s"%(size))
s1 = Stats(defaultPath=path + "Results_%s_singleApp1" % (size))
#s2 = Stats(defaultPath=path+"Results_%s_singleApp2" % (size))
#Network
#s.showResults2(size, time_loops=time_loops)
#app1 based on dinamic Edge
s1.showResults2(size, time_loops=time_loops)
#app2 based on static Cloud
#s2.showResults2(size, time_loops=time_loops)

df = s1.df
dfl = s1.df_link

#df["date"]=df.time_in.astype('timedelta64[s]')
df["date"] = df.time_in.astype('datetime64[s]')
df.index = df.date
Exemplo n.º 6
0
    s.run(stop_time, show_progress_monitor=False)

    # s.draw_allocated_topology() # for debugging


if __name__ == '__main__':
    import logging.config
    import os

    logging.config.fileConfig(os.getcwd() + '/logging.ini')

    start_time = time.time()
    main(simulated_time=1000)

    print("\n--- %s seconds ---" % (time.time() - start_time))

    ### Finally, you can analyse the results:
    print "-" * 20
    print "Results:"
    print "-" * 20
    m = Stats(defaultPath="Results")  #Same name of the results
    time_loops = [["M.A", "M.B"]]
    m.showResults2(1000, time_loops=time_loops)
    print "\t- Network saturation -"
    print "\t\tAverage waiting messages : %i" % m.average_messages_not_transmitted(
    )
    print "\t\tPeak of waiting messages : %i" % m.peak_messages_not_transmitted(
    )
    print "\t\tTOTAL messages not transmitted: %i" % m.messages_not_transmitted(
    )