diff --git a/web3_proxy/src/frontend/users.rs b/web3_proxy/src/frontend/users.rs index 601bf3fa..4d5925df 100644 --- a/web3_proxy/src/frontend/users.rs +++ b/web3_proxy/src/frontend/users.rs @@ -724,7 +724,6 @@ pub async fn rpc_keys_management( /// `GET /user/revert_logs` -- Use a bearer token to get the user's revert logs. #[debug_handler] - pub async fn user_revert_logs_get( Extension(app): Extension>, TypedHeader(Authorization(bearer)): TypedHeader>, @@ -780,7 +779,6 @@ pub async fn user_revert_logs_get( /// `GET /user/stats/aggregate` -- Public endpoint for aggregate stats such as bandwidth used and methods requested. #[debug_handler] - pub async fn user_stats_aggregated_get( Extension(app): Extension>, bearer: Option>>, @@ -801,7 +799,6 @@ pub async fn user_stats_aggregated_get( /// /// TODO: this will change as we add better support for secondary users. #[debug_handler] - pub async fn user_stats_detailed_get( Extension(app): Extension>, bearer: Option>>, diff --git a/web3_proxy/src/user_queries.rs b/web3_proxy/src/user_queries.rs index 9236a9cd..92cc3126 100644 --- a/web3_proxy/src/user_queries.rs +++ b/web3_proxy/src/user_queries.rs @@ -264,10 +264,6 @@ pub async fn query_user_stats<'a>( let q = rpc_accounting::Entity::find() .select_only() - .column_as( - rpc_accounting::Column::FrontendRequests.count(), - "total_rows", - ) .column_as( rpc_accounting::Column::FrontendRequests.sum(), "total_frontend_requests", @@ -400,7 +396,17 @@ pub async fn query_user_stats<'a>( serde_json::to_value(page_size).expect("can't fail"), ); - // query the database + // query the database for number of items and pages + let pages_result = q + .clone() + .paginate(&db_conn, page_size) + .num_items_and_pages() + .await?; + + response.insert("num_items", pages_result.number_of_items.into()); + response.insert("num_pages", pages_result.number_of_pages.into()); + + // query the database (todo: combine with the pages_result query?) let query_response = q .into_json() .paginate(&db_conn, page_size)