File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use chrono::Utc;
66use datafusion:: common:: tree_node:: TreeNode ;
77use std:: net:: SocketAddr ;
88use std:: sync:: Arc ;
9+ use std:: time:: Instant ;
910
1011use futures_util:: { Future , TryFutureExt } ;
1112
@@ -16,6 +17,7 @@ use crate::event::commit_schema;
1617use crate :: handlers:: http:: cluster:: get_ingestor_info;
1718use crate :: handlers:: http:: fetch_schema;
1819use crate :: handlers:: http:: ingest:: push_logs_unchecked;
20+ use crate :: metrics:: QUERY_EXECUTE_TIME ;
1921use crate :: option:: { Mode , CONFIG } ;
2022
2123use crate :: handlers:: livetail:: cross_origin_config;
@@ -189,6 +191,7 @@ impl FlightService for AirServiceImpl {
189191 Status :: permission_denied ( "User Does not have permission to access this" )
190192 } ) ?;
191193
194+ let time = Instant :: now ( ) ;
192195 let ( results, _) = query
193196 . execute ( stream_name. clone ( ) )
194197 . await
@@ -221,6 +224,12 @@ impl FlightService for AirServiceImpl {
221224 event. clear ( & stream_name) ;
222225 }
223226 }
227+
228+ let time = time. elapsed ( ) . as_secs_f64 ( ) ;
229+ QUERY_EXECUTE_TIME
230+ . with_label_values ( & [ "flight-query" , & stream_name] )
231+ . observe ( time) ;
232+
224233 Ok ( Response :: new ( Box :: pin ( output) as Self :: DoGetStream ) )
225234 }
226235
You can’t perform that action at this time.
0 commit comments