Compare commits

...

7 Commits

3 changed files with 17 additions and 16 deletions

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: 'localhost', host: 'minecraft2.lan',
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 = 10000 max_packets = 1000
trace_files = ["bedrock-60s", "java-60s"] trace_files = ["bedrock-60s", "java-60s"]
metrics_dict = { metrics_dict = {
@ -81,13 +81,14 @@ for trace_file in trace_files:
metrics_df_all = pd.DataFrame(metrics_dict) metrics_df_all = pd.DataFrame(metrics_dict)
test_labels = {"java-60s": "Java (60s)", "bedrock-60s": "Bedrock (60s)"} test_labels = {"java-60s": "Java (TCP)", "bedrock-60s": "Bedrock (UDP)"}
# Gráfico do total de pacotes # Gráfico do total de pacotes
plt.figure(figsize=(12, 6)) total_packets_values = [96849, 348204]
metrics_df_all.plot(kind="bar", x="test_name", y="total_packets", legend=False) plt.figure(figsize=(6.4, 4.8))
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()
@ -96,9 +97,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", x="test_name", y="average_packet_size_kb", legend=False) metrics_df_all.plot(kind="bar", 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()
@ -107,9 +108,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", x="test_name", y="average_latency_ms", legend=False) metrics_df_all.plot(kind="bar", 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: 'localhost', host: 'mine.tribufu.com',
port: 25565, port: 45565,
username: `Bot${i}`, username: `Bot${i}`,
auth: 'offline' auth: 'offline'
}); });