@@ -78,8 +78,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
7878 . init ( ) ;
7979
8080 // Load configs the same way main.rs does
81- let inference_config =
82- read_inference_config ( "examples/promql/inference_config.yaml" , QueryLanguage :: promql) ?;
81+ let inference_config = read_inference_config (
82+ "examples/promql/inference_config.yaml" ,
83+ QueryLanguage :: promql,
84+ ) ?;
8385 println ! (
8486 "Loaded inference config with {} query configs" ,
8587 inference_config. query_configs. len( )
@@ -101,13 +103,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
101103 println ! ( "\n === Starting precompute engine (ingest={INGEST_PORT}, query={QUERY_PORT}) ===" ) ;
102104
103105 // Create store
104- let store: Arc < dyn query_engine_rust:: stores:: Store > = Arc :: new (
105- SimpleMapStore :: new_with_strategy (
106+ let store: Arc < dyn query_engine_rust:: stores:: Store > =
107+ Arc :: new ( SimpleMapStore :: new_with_strategy (
106108 streaming_config. clone ( ) ,
107109 cleanup_policy,
108110 LockStrategy :: PerKey ,
109- ) ,
110- ) ;
111+ ) ) ;
111112
112113 // Start query server
113114 let query_engine = Arc :: new ( SimpleEngine :: new (
@@ -207,9 +208,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
207208
208209 // Use the exact query pattern from inference_config
209210 let queries_instant = vec ! [
210- ( "quantile by (label_0) (0.99, fake_metric)" , "10" , "Configured query at t=10" ) ,
211- ( "quantile by (label_0) (0.99, fake_metric)" , "15" , "Configured query at t=15" ) ,
212- ( "sum_over_time(fake_metric[1s])" , "10" , "Temporal: sum_over_time at t=10" ) ,
211+ (
212+ "quantile by (label_0) (0.99, fake_metric)" ,
213+ "10" ,
214+ "Configured query at t=10" ,
215+ ) ,
216+ (
217+ "quantile by (label_0) (0.99, fake_metric)" ,
218+ "15" ,
219+ "Configured query at t=15" ,
220+ ) ,
221+ (
222+ "sum_over_time(fake_metric[1s])" ,
223+ "10" ,
224+ "Temporal: sum_over_time at t=10" ,
225+ ) ,
213226 ( "sum(fake_metric)" , "10" , "Spatial: sum at t=10" ) ,
214227 ] ;
215228
@@ -272,11 +285,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
272285 raw_mode_aggregation_id : raw_agg_id,
273286 } ;
274287 let raw_sink = Arc :: new ( RawPassthroughSink :: new ( store. clone ( ) ) ) ;
275- let raw_engine = PrecomputeEngine :: new (
276- raw_engine_config,
277- streaming_config. clone ( ) ,
278- raw_sink,
279- ) ;
288+ let raw_engine = PrecomputeEngine :: new ( raw_engine_config, streaming_config. clone ( ) , raw_sink) ;
280289 tokio:: spawn ( async move {
281290 if let Err ( e) = raw_engine. run ( ) . await {
282291 eprintln ! ( "Raw precompute engine error: {e}" ) ;
@@ -299,20 +308,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
299308 . body ( body)
300309 . send ( )
301310 . await ?;
302- println ! ( " Sent raw t={ts}ms v={val} -> HTTP {}" , resp. status( ) . as_u16( ) ) ;
311+ println ! (
312+ " Sent raw t={ts}ms v={val} -> HTTP {}" ,
313+ resp. status( ) . as_u16( )
314+ ) ;
303315 }
304316
305317 // Short wait for processing (no watermark advancement needed)
306318 tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 500 ) ) . await ;
307319
308320 // Verify raw samples appeared in the store
309321 println ! ( "\n === Verifying raw samples in store ===" ) ;
310- let results = store. query_precomputed_output (
311- "fake_metric" ,
312- raw_agg_id,
313- 100_000 ,
314- 103_000 ,
315- ) ?;
322+ let results = store. query_precomputed_output ( "fake_metric" , raw_agg_id, 100_000 , 103_000 ) ?;
316323 let total_buckets: usize = results. values ( ) . map ( |v| v. len ( ) ) . sum ( ) ;
317324 println ! ( " Found {total_buckets} buckets for aggregation_id={raw_agg_id} in [100000, 103000)" ) ;
318325 assert ! (
0 commit comments