Skip to content

Commit 376bc1f

Browse files
committed
Merge from local PR
2 parents 9127303 + 40ee48e commit 376bc1f

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

src/pyroscope.rs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/session.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn test_session_new() {
2424
application_name: "test".to_string(),
2525
tags: HashMap::new(),
2626
sample_rate: 100,
27-
accumulation_cycle: Duration::from_secs(10),
2827
};
2928

3029
let report = vec![1, 2, 3];
@@ -42,7 +41,6 @@ fn test_session_send_error() {
4241
application_name: "test".to_string(),
4342
tags: HashMap::new(),
4443
sample_rate: 100,
45-
accumulation_cycle: Duration::from_secs(10),
4644
};
4745

4846
let report = vec![1, 2, 3];

0 commit comments

Comments
 (0)