File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -817,7 +817,9 @@ def from_stats(
817817 ],
818818 iter_counts = [req .output_tokens for req in total_with_output_first ],
819819 first_iter_counts = [
820- req .prompt_tokens + 1 for req in total_with_output_first
820+ # prompt tokens + first token
821+ req .prompt_tokens + 1
822+ for req in total_with_output_first
821823 ],
822824 ),
823825 ),
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ def from_values(
219219 )
220220
221221 @staticmethod
222- def from_request_times ( # noqa: C901
222+ def from_request_times (
223223 requests : list [tuple [float , float ]],
224224 distribution_type : Literal ["concurrency" , "rate" ],
225225 include_cdf : bool = False ,
@@ -243,12 +243,9 @@ def from_request_times( # noqa: C901
243243 """
244244 if distribution_type == "concurrency" :
245245 # convert to delta changes based on when requests were running
246- time_deltas : dict [float , int ] = defaultdict (int )
247- for start , end in requests :
248- time_deltas [start ] += 1
249- time_deltas [end ] -= 1
250-
251- events = list (time_deltas .items ())
246+ events = [(start , 1 ) for start , _ in requests ] + [
247+ (end , - 1 ) for _ , end in requests
248+ ]
252249 elif distribution_type == "rate" :
253250 # convert to events for when requests finished
254251 global_start = min (start for start , _ in requests ) if requests else 0
You can’t perform that action at this time.
0 commit comments