1 Commits

Author SHA1 Message Date
32a09dfc68 Bump express from 4.19.2 to 4.21.0
Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.21.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 15:52:34 +00:00
4 changed files with 1368 additions and 1079 deletions

2414
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ function getRandomMovement() {
for (let i = startBotIndex; i < endBotIndex; i++) { for (let i = startBotIndex; i < endBotIndex; i++) {
const bot = bedrock.createClient({ const bot = bedrock.createClient({
host: 'minecraft2.lan', host: 'localhost',
port: 19132, port: 19132,
username: `Bot${i}`, username: `Bot${i}`,
version: '1.20.0', version: '1.20.0',

View File

@ -5,7 +5,7 @@ import pyshark
import pandas as pd import pandas as pd
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
max_packets = 1000 max_packets = 10000
trace_files = ["bedrock-60s", "java-60s"] trace_files = ["bedrock-60s", "java-60s"]
metrics_dict = { metrics_dict = {
@ -29,21 +29,21 @@ for trace_file in trace_files:
timestamp = float(packet.sniff_timestamp) timestamp = float(packet.sniff_timestamp)
# Tamanho do pacote em bytes # Tamanho do pacote em bytes
packet_size = int(packet.length) packet_size = int(packet.length)
if "TCP" in packet: if "TCP" in packet:
ack_flag = int(packet.tcp.flags_ack) if hasattr(packet.tcp, "flags_ack") else 0 ack_flag = int(packet.tcp.flags_ack) if hasattr(packet.tcp, "flags_ack") else 0
syn_flag = int(packet.tcp.flags_syn) if hasattr(packet.tcp, "flags_syn") else 0 syn_flag = int(packet.tcp.flags_syn) if hasattr(packet.tcp, "flags_syn") else 0
else: else:
ack_flag = 0 ack_flag = 0
syn_flag = 0 syn_flag = 0
data.append({ data.append({
"timestamp": timestamp, "timestamp": timestamp,
"packet_size": packet_size, "packet_size": packet_size,
"ack_flag": ack_flag, "ack_flag": ack_flag,
"syn_flag": syn_flag "syn_flag": syn_flag
}) })
packet_count += 1 packet_count += 1
if packet_count >= max_packets: if packet_count >= max_packets:
@ -76,19 +76,18 @@ for trace_file in trace_files:
"total_syns": total_syns, "total_syns": total_syns,
"average_latency_ms": round(average_latency, 2) "average_latency_ms": round(average_latency, 2)
}]) }])
metrics_df.to_csv(f"./trace/{trace_file}.csv", index=False) metrics_df.to_csv(f"./trace/{trace_file}.csv", index=False)
metrics_df_all = pd.DataFrame(metrics_dict) metrics_df_all = pd.DataFrame(metrics_dict)
test_labels = {"java-60s": "Java (TCP)", "bedrock-60s": "Bedrock (UDP)"} test_labels = {"java-60s": "Java (60s)", "bedrock-60s": "Bedrock (60s)"}
# Gráfico do total de pacotes # Gráfico do total de pacotes
total_packets_values = [96849, 348204] plt.figure(figsize=(12, 6))
plt.figure(figsize=(6.4, 4.8)) metrics_df_all.plot(kind="bar", x="test_name", y="total_packets", legend=False)
plt.bar(trace_files, total_packets_values)
plt.title("Total de Pacotes por Teste") plt.title("Total de Pacotes por Teste")
#plt.xlabel("Teste") plt.xlabel("Teste")
plt.ylabel("Total de Pacotes") plt.ylabel("Total de Pacotes")
plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45) plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45)
plt.tight_layout() plt.tight_layout()
@ -97,9 +96,9 @@ plt.close()
# Gráfico do tamanho médio dos pacotes # Gráfico do tamanho médio dos pacotes
plt.figure(figsize=(12, 6)) plt.figure(figsize=(12, 6))
metrics_df_all.plot(kind="bar", y="average_packet_size_kb", legend=False) metrics_df_all.plot(kind="bar", x="test_name", y="average_packet_size_kb", legend=False)
plt.title("Tamanho Médio dos Pacotes por Teste") plt.title("Tamanho Médio dos Pacotes por Teste")
#plt.xlabel("Teste") plt.xlabel("Teste")
plt.ylabel("Tamanho Médio dos Pacotes (kB)") plt.ylabel("Tamanho Médio dos Pacotes (kB)")
plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45) plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45)
plt.tight_layout() plt.tight_layout()
@ -108,9 +107,9 @@ plt.close()
# Gráfico da latência média # Gráfico da latência média
plt.figure(figsize=(12, 6)) plt.figure(figsize=(12, 6))
metrics_df_all.plot(kind="bar", y="average_latency_ms", legend=False) metrics_df_all.plot(kind="bar", x="test_name", y="average_latency_ms", legend=False)
plt.title("Latência Média por Teste") plt.title("Latência Média por Teste")
#plt.xlabel("Teste") plt.xlabel("Teste")
plt.ylabel("Latência Média (ms)") plt.ylabel("Latência Média (ms)")
plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45) plt.xticks(ticks=range(len(test_labels)), labels=[test_labels[file] for file in trace_files], rotation=45)
plt.tight_layout() plt.tight_layout()

View File

@ -13,8 +13,8 @@ function getRandomMovement() {
for (let i = startBotIndex; i < endBotIndex; i++) { for (let i = startBotIndex; i < endBotIndex; i++) {
const bot = mineflayer.createBot({ const bot = mineflayer.createBot({
host: 'mine.tribufu.com', host: 'localhost',
port: 45565, port: 25565,
username: `Bot${i}`, username: `Bot${i}`,
auth: 'offline' auth: 'offline'
}); });