Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

new metric for percentage of cpu usage #128

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix typo
kaylarizi committed Feb 14, 2024
commit 1e89fdd1e104107159441317a56ae26ecb71e43f
2 changes: 1 addition & 1 deletion api/src/enums/metric.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
class Metric(Enum):
SERVER_AVERAGE_CPU_CORES = 'server_avg_cpu_cores'
SERVER_AVERAGE_MEMORY = 'server_avg_memory'
SERVER_AVERAGE_CPU = 'sever_avg_cpu'
SERVER_AVERAGE_CPU = 'server_avg_cpu'
CLIENT_AVERAGE_CPU_CORES = 'client_avg_cpu_cores'
CLIENT_AVERAGE_MEMORY = 'client_avg_memory'
CLIENT_AVERAGE_CPU = 'client_avg_cpu'
2 changes: 1 addition & 1 deletion api/src/services/metrics_service.py
Original file line number Diff line number Diff line change
@@ -53,5 +53,5 @@ def __calculate_throughput(iterations, start_time, end_time, requests_size):
seconds = (end_time - start_time).total_seconds()
request_throughput = 0 if seconds == 0 else iterations / seconds
bytes_throughput = 0 if seconds == 0 or requests_size is None else int(requests_size) / seconds
return round(request_throughput, 0), round(bytes_throughput, 0)
return round(request_throughput, 2), round(bytes_throughput, 0)

2 changes: 1 addition & 1 deletion mysql/scripts/init-db.sql
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS test_runs (

CREATE TABLE IF NOT EXISTS test_run_metrics (
test_run_id INT,
metric_name ENUM('server_avg_cpu_cores', 'server_avg_memory', 'sever_avg_cpu', 'client_avg_cpu_cores', 'client_avg_memory', 'client_avg_cpu', 'error_rate', 'bytes_throughput_per_sec', 'msg_throughput_per_sec', 'avg_tls_handshake_time'),
metric_name ENUM('server_avg_cpu_cores', 'server_avg_memory', 'server_avg_cpu', 'client_avg_cpu_cores', 'client_avg_memory', 'client_avg_cpu', 'error_rate', 'bytes_throughput_per_sec', 'msg_throughput_per_sec', 'avg_tls_handshake_time'),
value DOUBLE,
PRIMARY KEY (test_run_id, metric_name),
FOREIGN KEY (test_run_id) REFERENCES test_runs(id) ON DELETE CASCADE