File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,7 @@ pub async fn count_group_chunks(
507507 _user : LoggedUser ,
508508 pool : web:: Data < Pool > ,
509509) -> Result < HttpResponse , ServiceError > {
510+ let mut timer = Timer :: new ( ) ;
510511 let dataset_config =
511512 DatasetConfiguration :: from_json ( dataset_org_plan_sub. dataset . server_configuration . clone ( ) ) ;
512513
@@ -530,16 +531,23 @@ pub async fn count_group_chunks(
530531 ) ) ;
531532 } ;
532533
534+ timer. add ( "fetch group id" ) ;
535+
533536 // check if group exists
534537 get_group_by_id_query ( group_id, dataset_org_plan_sub. dataset . id , pool. clone ( ) ) . await ?;
538+ timer. add ( "check postgres group exists" ) ;
535539
536540 let group_size =
537541 get_group_size_query ( group_id, dataset_org_plan_sub. dataset . id , dataset_config) . await ?;
538542
539- Ok ( HttpResponse :: Ok ( ) . json ( GetChunkGroupCountResponse {
540- group_id,
541- count : group_size,
542- } ) )
543+ timer. add ( "Check qdrant for group size" ) ;
544+
545+ Ok ( HttpResponse :: Ok ( )
546+ . insert_header ( ( Timer :: header_key ( ) , timer. header_value ( ) ) )
547+ . json ( GetChunkGroupCountResponse {
548+ group_id,
549+ count : group_size,
550+ } ) )
543551}
544552
545553#[ derive( Deserialize , Serialize , Debug , ToSchema ) ]
You can’t perform that action at this time.
0 commit comments