@@ -76,30 +76,57 @@ def write_to_json(
7676 if not issues_with_metrics :
7777 return ""
7878
79+ # time to first response
7980 average_time_to_first_response = None
81+ med_time_to_first_response = None
82+ p90_time_to_first_response = None
8083 if stats_time_to_first_response is not None :
8184 average_time_to_first_response = stats_time_to_first_response ['avg' ]
85+ med_time_to_first_response = stats_time_to_first_response ['med' ]
86+ p90_time_to_first_response = stats_time_to_first_response ['90p' ]
8287
88+ # time to close
8389 average_time_to_close = None
90+ med_time_to_close = None
91+ p90_time_to_close = None
8492 if stats_time_to_close is not None :
8593 average_time_to_close = stats_time_to_close ['avg' ]
94+ med_time_to_close = stats_time_to_close ['med' ]
95+ p90_time_to_close = stats_time_to_close ['90p' ]
8696
97+ # time to answer
8798 average_time_to_answer = None
99+ med_time_to_answer = None
100+ p90_time_to_answer = None
88101 if stats_time_to_answer is not None :
89102 average_time_to_answer = stats_time_to_answer ['avg' ]
103+ med_time_to_answer = stats_time_to_answer ['med' ]
104+ p90_time_to_answer = stats_time_to_answer ['90p' ]
90105
91106 average_time_in_labels = {}
92- for stats_type , labels in stats_time_in_labels .items ():
93- if stats_type == 'avg' :
94- for label , time in labels .items ():
95- average_time_in_labels [label ] = str (time )
107+ med_time_in_labels = {}
108+ p90_time_in_labels = {}
109+ for label , time in stats_time_in_labels ['avg' ].items ():
110+ average_time_in_labels [label ] = str (time )
111+ for label , time in stats_time_in_labels ['med' ].items ():
112+ med_time_in_labels [label ] = str (time )
113+ for label , time in stats_time_in_labels ['90p' ].items ():
114+ p90_time_in_labels [label ] = str (time )
96115
97116 # Create a dictionary with the metrics
98117 metrics = {
99118 "average_time_to_first_response" : str (average_time_to_first_response ),
100119 "average_time_to_close" : str (average_time_to_close ),
101120 "average_time_to_answer" : str (average_time_to_answer ),
102121 "average_time_in_labels" : average_time_in_labels ,
122+ "median_time_to_first_response" : str (med_time_to_first_response ),
123+ "median_time_to_close" : str (med_time_to_close ),
124+ "median_time_to_answer" : str (med_time_to_answer ),
125+ "median_time_in_labels" : med_time_in_labels ,
126+ "90_percentile_time_to_first_response" : str (p90_time_to_first_response ),
127+ "90_percentile_time_to_close" : str (p90_time_to_close ),
128+ "90_percentile_time_to_answer" : str (p90_time_to_answer ),
129+ "90_percentile_time_in_labels" : p90_time_in_labels ,
103130 "num_items_opened" : num_issues_opened ,
104131 "num_items_closed" : num_issues_closed ,
105132 "total_item_count" : len (issues_with_metrics ),
0 commit comments