catch the case where all benchmarks fail (sets error)
This commit is contained in:
@@ -350,6 +350,9 @@ class Backend:
|
|||||||
total_workload = sum(br.workload for br in benchmark_requests if br.is_successful)
|
total_workload = sum(br.workload for br in benchmark_requests if br.is_successful)
|
||||||
time_elapsed = time.time() - start
|
time_elapsed = time.time() - start
|
||||||
successful_responses = sum([1 for br in benchmark_requests if br.is_successful])
|
successful_responses = sum([1 for br in benchmark_requests if br.is_successful])
|
||||||
|
if successful_responses == 0:
|
||||||
|
self.backend_errored("No successful responses from benchmark")
|
||||||
|
log.debug(f"benchmark failed: {successful_responses}/{concurrent_requests} successful responses")
|
||||||
|
|
||||||
throughput = total_workload / time_elapsed
|
throughput = total_workload / time_elapsed
|
||||||
sum_throughput += throughput
|
sum_throughput += throughput
|
||||||
|
|||||||
+1
-1
@@ -257,7 +257,7 @@ class ModelMetrics:
|
|||||||
def wait_time(self) -> float:
|
def wait_time(self) -> float:
|
||||||
if (len(self.requests_working) == 0):
|
if (len(self.requests_working) == 0):
|
||||||
return 0.0
|
return 0.0
|
||||||
return sum([request.workload for request in self.requests_working.values()]) / self.max_throughput
|
return sum([request.workload for request in self.requests_working.values()]) / max(self.max_throughput, 0.00001)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cur_load(self) -> float:
|
def cur_load(self) -> float:
|
||||||
|
|||||||
Reference in New Issue
Block a user