<jupyter_start><jupyter_text>Latency<jupyter_code>df_resample = df.resample('100s').agg(dict(time_latency='mean'))
df_resample.shape
timeLatency = df_resample.time_latency.values
ticks = range(len(timeLatency))
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(ticks, timeLatency, '-')
ax1.set_ylim(timeLatency.min()-0.5,6)#timeLatency.max()+0.5)
ax1.set_xlabel("Simulation time", fontsize=16)
ax1.set_ylabel("Latency time", fontsize=16)<jupyter_output><empty_output><jupyter_text>Hop Count<jupyter_code># Hop count
cache_distance = {}
G = nx.read_graphml('results/graph.graphml')
print(G.nodes())
def compute_distance(k):
    return nx.shortest_path_length(G,str(k[0]),str(k[1]))
for row in df[["TOPO.src","TOPO.dst"]].iterrows():
    k = (row[1][0],row[1][1])
    if not k in cache_distance.keys():
        cache_distance[k] = compute_distance(k)
x = cache_distance.values() 
counter = collections.Counter(x)
print(counter)
data_a = {}
for k in range(5):
    data_a[k] = counter[k]
data_a
data_a = data_a.values()
ticks = range(5)
N = len(ticks)
ind = np.array(ticks)
width = 0.45
fig, ax = plt.subplots(figsize=(8.0,4.0))
ax.get_xaxis().set_ticks(range(0, len(ticks) * 2, 2))
r = ax.bar(ind, data_a, width, color='r')
ax.set_xticks(ind+ width/2)
ax.set_xticklabels(ticks, fontsize=12)
ax.set_title("App")
ax.set_xlim(-width, len(ticks))
ax.plot([], c='#a6bddb', label="No LABEL",linewidth=3)
ax.set_xlabel("Hop count among services", fontsize=18)
ax.set_ylabel("Quantity", fontsize=20)
plt.legend([r],['No label'],loc="upper right",fontsize=14)
plt.tight_layout()
df_link = pd.read_csv('results/sim_trace_link.csv')
df_link.head(60)
total_messages = len(df_link)
print(f'total messages transmited = {total_messages}')
bytes_transmited = df_link["size"].sum()
print(f'total bytes transmited = {bytes_transmited}')
def utilization(id_entity, total_time, from_time=0.0):
        if "time_service" not in df.columns: #cached
            df["time_service"] = df.time_out - df.time_in
        values = df.groupby("DES.dst").time_service.agg("sum")
        return values[id_entity] / total_time
values = df.groupby("DES.dst").time_service.agg("sum")
values<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1751257430269776, 'fraction_numerical': 0.02423411065386374, 'mean_word_length': 6.317725752508361, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '132341', 'license': 'MIT', 'n_tokens_mistral': 900, 'n_tokens_neox': 875, 'n_words': 137, 'path': 'src/sim/DynamicAllocNew/results/.ipynb_checkpoints/DynamicAllocNew-checkpoint.ipynb', 'repo_name': 'andremtsilva/dissertacao', 'size': '2187'}