Skip to content

Commit

Permalink
improve fairness of processing_time algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
francesconazzaro committed Oct 22, 2024
1 parent 39abb14 commit b7b9df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cads_broker/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def get_users_queue_from_processing_time(
interval_start = interval_stop - interval
request_processing_time = sa.sql.func.least(
SystemRequest.finished_at, interval_stop
) - sa.sql.func.greatest(SystemRequest.started_at, interval_start)
) - SystemRequest.started_at
user_cumulative_processing_time = sa.sql.func.sum(request_processing_time)
user_cost = (
sa.sql.func.extract("epoch", user_cumulative_processing_time)
Expand Down

0 comments on commit b7b9df7

Please sign in to comment.