@@ -33,7 +33,9 @@ use datafusion::{
3333use datafusion_common:: { DataFusionError , Result } ;
3434use object_store:: local:: LocalFileSystem ;
3535
36- use super :: latency_object_store:: LatencyObjectStore ;
36+ use super :: simulated_object_store:: {
37+ BYTES_PER_SECOND , MAX_CONNECTIONS , SimulatedObjectStore ,
38+ } ;
3739
3840// Common benchmark options (don't use doc comments otherwise this doc
3941// shows up in help files)
@@ -69,8 +71,10 @@ pub struct CommonOpt {
6971 #[ arg( short, long, env) ]
7072 pub debug : bool ,
7173
72- /// Simulate object store latency to mimic remote storage (e.g. S3).
73- /// Adds random latency in the range 20-200ms to each object store operation.
74+ /// Serve the local filesystem as if it were remote object storage (e.g. S3
75+ /// or GCS): per-request latency, per-connection bandwidth, a bounded
76+ /// connection pool, and paginated LIST. See
77+ /// [`crate::util::simulated_object_store`].
7478 #[ arg( long = "simulate-latency" , env) ]
7579 pub simulate_latency : bool ,
7680}
@@ -138,17 +142,18 @@ impl CommonOpt {
138142 Ok ( rt_builder)
139143 }
140144
141- /// Build the runtime environment, optionally wrapping the local filesystem
142- /// with a throttled object store to simulate remote storage latency .
145+ /// Build the runtime environment, optionally presenting the local
146+ /// filesystem as remote object storage.
143147 pub fn build_runtime ( & self ) -> Result < Arc < RuntimeEnv > > {
144148 let rt = self . runtime_env_builder ( ) ?. build_arc ( ) ?;
145149 if self . simulate_latency {
146- let store: Arc < dyn object_store:: ObjectStore > =
147- Arc :: new ( LatencyObjectStore :: new ( LocalFileSystem :: new ( ) ) ) ;
150+ let store = SimulatedObjectStore :: new ( LocalFileSystem :: new ( ) ) ;
148151 let url = ObjectStoreUrl :: parse ( "file:///" ) ?;
149- rt. register_object_store ( url. as_ref ( ) , store) ;
152+ rt. register_object_store ( url. as_ref ( ) , Arc :: new ( store) ) ;
150153 println ! (
151- "Simulating S3-like object store latency (get: 25-200ms, list: 40-400ms)"
154+ "Simulating remote object storage (get TTFB: 25-200ms, list TTFB: \
155+ 40-400ms/page, {} MB/s per connection, {MAX_CONNECTIONS} connections)",
156+ BYTES_PER_SECOND / ( 1024 * 1024 ) ,
152157 ) ;
153158 }
154159 Ok ( rt)
0 commit comments