Skip to content

Commit b453009

Browse files
authored
Merge pull request #26 from pyroscope-io/0.5.1
0.5.1
2 parents 039b270 + 0a74c23 commit b453009

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Pyroscope Profiler Agent for continuous profiling of Rust, Python and Ruby appli
55
"""
66
keywords = ["pyroscope", "profiler", "profiling", "pprof"]
77
authors = ["Abid Omar <[email protected]>"]
8-
version = "0.5.0"
8+
version = "0.5.1"
99
edition = "2021"
1010
license = "Apache-2.0"
1111
homepage = "https://pyroscope.io/docs/rust"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ pyroscope = "0.5.0"
3636
pyroscope-pprofrs = "0.2"
3737
```
3838

39-
Configure and create the backend (pprof-rs)
39+
Include Pyroscope and pprof-rs dependencies:
4040

4141
```rust
42-
let pprof_config = PprofConfig::new().sample_rate(100);
43-
let pprof_backend = Pprof::new(pprof_config);
42+
use pyroscope::PyroscopeAgent;
43+
use pyroscope_pprofrs::{pprof_backend, PprofConfig};
4444
```
4545

4646
Configure the Pyroscope agent:
4747

4848
```rust
4949
let agent =
5050
PyroscopeAgent::builder("http://localhost:4040", "myapp-profile")
51-
.backend(pprof_backend)
51+
.backend(pprof_backend(PprofConfig::new().sample_rate(100)))
5252
.build()?;
5353
```
5454

src/pyroscope.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ impl<S: PyroscopeAgentState> PyroscopeAgent<S> {
266266
pub fn shutdown(mut self) {
267267
log::debug!(target: LOG_TAG, "PyroscopeAgent::drop()");
268268

269+
// Shutdown Backend
270+
match self.backend.shutdown() {
271+
Ok(_) => log::debug!(target: LOG_TAG, "Backend shutdown"),
272+
Err(e) => log::error!(target: LOG_TAG, "Backend shutdown error: {}", e),
273+
}
274+
269275
// Drop Timer listeners
270276
match self.timer.drop_listeners() {
271277
Ok(_) => log::trace!(target: LOG_TAG, "Dropped timer listeners"),

0 commit comments

Comments
 (0)