@@ -14,7 +14,6 @@ use crate::{
1414 extractors:: { DbConnection , Path } ,
1515 file:: File ,
1616 match_version,
17- metrics:: RenderingTimesRecorder ,
1817 page:: TemplateData ,
1918 MetaData , ReqVersion ,
2019 } ,
@@ -90,7 +89,6 @@ async fn try_serve_legacy_toolchain_asset(
9089#[ instrument( skip_all) ]
9190pub ( crate ) async fn rustdoc_redirector_handler (
9291 Path ( params) : Path < RustdocRedirectorParams > ,
93- Extension ( metrics) : Extension < Arc < InstanceMetrics > > ,
9492 Extension ( storage) : Extension < Arc < AsyncStorage > > ,
9593 Extension ( config) : Extension < Arc < Config > > ,
9694 mut conn : DbConnection ,
@@ -116,16 +114,13 @@ pub(crate) async fn rustdoc_redirector_handler(
116114 ) ?)
117115 }
118116
119- let mut rendering_time = RenderingTimesRecorder :: new ( & metrics. rustdoc_redirect_rendering_times ) ;
120-
121117 // global static assets for older builds are served from the root, which ends up
122118 // in this handler as `params.name`.
123119 if let Some ( ( _, extension) ) = params. name . rsplit_once ( '.' ) {
124120 if [ "css" , "js" , "png" , "svg" , "woff" , "woff2" ]
125121 . binary_search ( & extension)
126122 . is_ok ( )
127123 {
128- rendering_time. step ( "serve static asset" ) ;
129124 return try_serve_legacy_toolchain_asset ( storage, config, params. name )
130125 . instrument ( info_span ! ( "serve static asset" ) )
131126 . await ;
@@ -162,7 +157,6 @@ pub(crate) async fn rustdoc_redirector_handler(
162157
163158 // it doesn't matter if the version that was given was exact or not, since we're redirecting
164159 // anyway
165- rendering_time. step ( "match version" ) ;
166160 let matched_release = match_version (
167161 & mut conn,
168162 & crate_name,
@@ -177,21 +171,16 @@ pub(crate) async fn rustdoc_redirector_handler(
177171 if let Some ( ref target) = params. target {
178172 if target. ends_with ( ".js" ) {
179173 // this URL is actually from a crate-internal path, serve it there instead
180- rendering_time. step ( "serve JS for crate" ) ;
181-
182174 return async {
183175 let krate = CrateDetails :: from_matched_release ( & mut conn, matched_release) . await ?;
184176
185- rendering_time. step ( "fetch from storage" ) ;
186-
187177 match storage
188178 . fetch_rustdoc_file (
189179 & crate_name,
190180 & krate. version . to_string ( ) ,
191181 krate. latest_build_id . unwrap_or ( 0 ) ,
192182 target,
193183 krate. archive_storage ,
194- Some ( & mut rendering_time) ,
195184 )
196185 . await
197186 {
@@ -231,8 +220,6 @@ pub(crate) async fn rustdoc_redirector_handler(
231220 }
232221
233222 if matched_release. rustdoc_status ( ) {
234- rendering_time. step ( "redirect to doc" ) ;
235-
236223 let url_str = if let Some ( target) = target {
237224 format ! (
238225 "/{crate_name}/{}/{target}/{}/" ,
@@ -261,7 +248,6 @@ pub(crate) async fn rustdoc_redirector_handler(
261248 ) ?
262249 . into_response ( ) )
263250 } else {
264- rendering_time. step ( "redirect to crate" ) ;
265251 Ok ( axum_cached_redirect (
266252 format ! ( "/crate/{crate_name}/{}" , matched_release. req_version) ,
267253 CachePolicy :: ForeverInCdn ,
@@ -361,8 +347,6 @@ pub(crate) async fn rustdoc_html_server_handler(
361347 Extension ( csp) : Extension < Arc < Csp > > ,
362348 uri : Uri ,
363349) -> AxumResult < AxumResponse > {
364- let mut rendering_time = RenderingTimesRecorder :: new ( & metrics. rustdoc_rendering_times ) ;
365-
366350 // since we directly use the Uri-path and not the extracted params from the router,
367351 // we have to percent-decode the string here.
368352 let original_path = percent_encoding:: percent_decode ( uri. path ( ) . as_bytes ( ) )
@@ -394,8 +378,6 @@ pub(crate) async fn rustdoc_html_server_handler(
394378 }
395379
396380 trace ! ( "match version" ) ;
397- rendering_time. step ( "match version" ) ;
398-
399381 let mut conn = pool. get_async ( ) . await ?;
400382
401383 // Check the database for releases with the requested version while doing the following:
@@ -430,13 +412,10 @@ pub(crate) async fn rustdoc_html_server_handler(
430412 } ) ?;
431413
432414 trace ! ( "crate details" ) ;
433- rendering_time. step ( "crate details" ) ;
434-
435415 // Get the crate's details from the database
436416 let krate = CrateDetails :: from_matched_release ( & mut conn, matched_release) . await ?;
437417
438418 if !krate. rustdoc_status {
439- rendering_time. step ( "redirect to crate" ) ;
440419 return Ok ( axum_cached_redirect (
441420 format ! ( "/crate/{}/{}" , params. name, params. version) ,
442421 CachePolicy :: ForeverInCdn ,
@@ -465,10 +444,6 @@ pub(crate) async fn rustdoc_html_server_handler(
465444
466445 trace ! ( ?storage_path, ?req_path, "try fetching from storage" ) ;
467446
468- // record the data-fetch step
469- // until we re-add it below inside `fetch_rustdoc_file`
470- rendering_time. step ( "fetch from storage" ) ;
471-
472447 // Attempt to load the file from the database
473448 let blob = match storage
474449 . fetch_rustdoc_file (
@@ -477,7 +452,6 @@ pub(crate) async fn rustdoc_html_server_handler(
477452 krate. latest_build_id . unwrap_or ( 0 ) ,
478453 & storage_path,
479454 krate. archive_storage ,
480- Some ( & mut rendering_time) ,
481455 )
482456 . await
483457 {
@@ -541,16 +515,13 @@ pub(crate) async fn rustdoc_html_server_handler(
541515 // Serve non-html files directly
542516 if !storage_path. ends_with ( ".html" ) {
543517 trace ! ( ?storage_path, "serve asset" ) ;
544- rendering_time. step ( "serve asset" ) ;
545518
546519 // default asset caching behaviour is `Cache::ForeverInCdnAndBrowser`.
547520 // This is an edge-case when we serve invocation specific static assets under `/latest/`:
548521 // https://github.com/rust-lang/docs.rs/issues/1593
549522 return Ok ( File ( blob) . into_response ( ) ) ;
550523 }
551524
552- rendering_time. step ( "find latest path" ) ;
553-
554525 let latest_release = krate. latest_release ( ) ?;
555526
556527 // Get the latest version of the crate
@@ -618,8 +589,6 @@ pub(crate) async fn rustdoc_html_server_handler(
618589 format ! ( "{target}/" )
619590 } ;
620591
621- rendering_time. step ( "rewrite html" ) ;
622-
623592 // Build the page of documentation,
624593 templates
625594 . render_in_threadpool ( {
0 commit comments