@@ -61,6 +61,16 @@ def get_exception_handler(self) -> Callable:
6161 return repo_auth_custom_exception_handler
6262
6363 def post (self , request : HttpRequest ) -> Response :
64+ sentry_metrics .incr (
65+ "upload" ,
66+ tags = generate_upload_sentry_metrics_tags (
67+ action = "bundle_analysis" ,
68+ endpoint = "bundle_analysis" ,
69+ request = self .request ,
70+ is_shelter_request = self .is_shelter_request (),
71+ position = "start" ,
72+ ),
73+ )
6474 serializer = UploadSerializer (data = request .data )
6575 if not serializer .is_valid ():
6676 return Response (serializer .errors , status = status .HTTP_400_BAD_REQUEST )
@@ -136,12 +146,6 @@ def post(self, request: HttpRequest) -> Response:
136146 ),
137147 )
138148
139- dispatch_upload_task (
140- task_arguments ,
141- repo ,
142- get_redis_connection (),
143- report_type = CommitReport .ReportType .BUNDLE_ANALYSIS ,
144- )
145149 sentry_metrics .incr (
146150 "upload" ,
147151 tags = generate_upload_sentry_metrics_tags (
@@ -150,9 +154,17 @@ def post(self, request: HttpRequest) -> Response:
150154 request = self .request ,
151155 repository = repo ,
152156 is_shelter_request = self .is_shelter_request (),
157+ position = "end" ,
153158 ),
154159 )
155160
161+ dispatch_upload_task (
162+ task_arguments ,
163+ repo ,
164+ get_redis_connection (),
165+ report_type = CommitReport .ReportType .BUNDLE_ANALYSIS ,
166+ )
167+
156168 if settings .TIMESERIES_ENABLED :
157169 supported_bundle_analysis_measurement_types = [
158170 MeasurementName .BUNDLE_ANALYSIS_ASSET_SIZE ,
0 commit comments