forked from mtusi2026/mtusi2026lab4
23 lines
863 B
Python
23 lines
863 B
Python
import matplotlib.pyplot as plt
|
|
import os
|
|
|
|
replicas = [1, 2, 4, 6]
|
|
rps = [250, 255, 260, 257]
|
|
|
|
plt.figure(figsize=(8, 5))
|
|
plt.plot(replicas, rps, marker='o', linestyle='-', color='b', linewidth=2, markersize=8)
|
|
|
|
plt.title('Трек 1: Масштабирование API (суммарно 2 CPU / 1 GB)', fontsize=14)
|
|
plt.xlabel('Количество API-реплик', fontsize=12)
|
|
plt.ylabel('RPS (запросов в секунду)', fontsize=12)
|
|
|
|
plt.grid(True, linestyle='--', alpha=0.7)
|
|
plt.xticks(replicas)
|
|
|
|
plt.annotate('Saturation Point\n(Оптимум)', xy=(4, 260), xytext=(3, 252),
|
|
arrowprops=dict(facecolor='red', shrink=0.05),
|
|
fontsize=10, color='red')
|
|
|
|
os.makedirs('evidence', exist_ok=True)
|
|
plt.savefig('evidence/scaling.png', dpi=300, bbox_inches='tight')
|
|
print("График сохранен в evidence/scaling.png") |