@@ -33,8 +33,6 @@ pub struct PyroscopeConfig {
3333 pub tags : HashMap < String , String > ,
3434 /// Sample rate used in Hz
3535 pub sample_rate : i32 ,
36- /// How long to accumulate data for before sending it upstream
37- pub accumulation_cycle : Duration ,
3836 // TODO
3937 // log_level
4038 // auth_token
@@ -55,7 +53,6 @@ impl PyroscopeConfig {
5553 application_name : application_name. as_ref ( ) . to_owned ( ) ,
5654 tags : HashMap :: new ( ) ,
5755 sample_rate : 100i32 ,
58- accumulation_cycle : Duration :: from_secs ( 10 ) ,
5956 }
6057 }
6158
@@ -73,27 +70,8 @@ impl PyroscopeConfig {
7370 }
7471 }
7572
76- /// Override the accumulation cycle.
77- ///
78- /// # Example
79- ///
80- /// ```
81- /// use std::time::Duration;
82- /// use pyroscope::pyroscope::PyroscopeConfig;
8373 /// # use pyroscope::PyroscopeError;
8474 /// # fn main() -> Result<(), PyroscopeError> {
85- /// let config = PyroscopeConfig::new("http://localhost:8080", "my-app")
86- /// .accumulation_cycle(Duration::from_millis(4587));
87- /// # Ok(())
88- /// # }
89- /// ```
90- pub fn accumulation_cycle ( self , accumulation_cycle : Duration ) -> Self {
91- Self {
92- accumulation_cycle,
93- ..self
94- }
95- }
96-
9775 /// Set the tags
9876 /// # Example
9977 /// ```ignore
@@ -183,29 +161,8 @@ impl PyroscopeAgentBuilder {
183161 }
184162 }
185163
186- /// Set the accumulation cycle. Default value is 10 seconds.
187- ///
188- /// # Example
189- ///
190- /// ```
191- /// use pyroscope::pyroscope::PyroscopeAgentBuilder;
192- /// use std::time::Duration;
193164 /// # use pyroscope::PyroscopeError;
194165 /// # fn main() -> Result<(), PyroscopeError> {
195- ///
196- /// let builder = PyroscopeAgentBuilder::new("http://localhost:8080", "my-app")
197- /// .accumulation_cycle(Duration::from_secs(3))
198- /// .build()?;
199- /// # Ok(())
200- /// # }
201- /// ```
202- pub fn accumulation_cycle ( self , acc_cycle : impl Into < Duration > ) -> Self {
203- Self {
204- config : self . config . accumulation_cycle ( acc_cycle. into ( ) ) ,
205- ..self
206- }
207- }
208-
209166 /// Set tags. Default is empty.
210167 /// # Example
211168 /// ```ignore
@@ -229,7 +186,7 @@ impl PyroscopeAgentBuilder {
229186 log:: trace!( target: LOG_TAG , "Backend initialized" ) ;
230187
231188 // Start Timer
232- let timer = Timer :: initialize ( self . config . accumulation_cycle . clone ( ) ) ?;
189+ let timer = Timer :: initialize ( std :: time :: Duration :: from_secs ( 10 ) ) ?;
233190 log:: trace!( target: LOG_TAG , "Timer initialized" ) ;
234191
235192 // Start the SessionManager
0 commit comments