Skip to content

Commit 9063c8e

Browse files
committed
Merge commit 'e9293edf'
2 parents 12053e4 + e9293ed commit 9063c8e

File tree

1 file changed

+5
-0
lines changed
  • pyroscope_backends/pyroscope_pprofrs/src

1 file changed

+5
-0
lines changed

pyroscope_backends/pyroscope_pprofrs/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ impl Default for PprofConfig {
3030
}
3131

3232
impl PprofConfig {
33+
/// Create a new Pprof configuration
3334
pub fn new() -> Self {
3435
PprofConfig::default()
3536
}
3637

38+
/// Set the sample rate
3739
pub fn sample_rate(self, sample_rate: u32) -> Self {
3840
PprofConfig { sample_rate }
3941
}
@@ -61,6 +63,7 @@ impl std::fmt::Debug for Pprof<'_> {
6163
}
6264

6365
impl<'a> Pprof<'a> {
66+
/// Create a new Pprof Backend
6467
pub fn new(config: PprofConfig) -> Self {
6568
Pprof {
6669
buffer: Arc::new(Mutex::new(StackBuffer::default())),
@@ -130,6 +133,7 @@ impl Backend for Pprof<'_> {
130133

131134
Ok(())
132135
}
136+
133137
fn remove_rule(&self, rule: Rule) -> Result<()> {
134138
if self.guard.lock()?.as_ref().is_some() {
135139
self.dump_report()?;
@@ -142,6 +146,7 @@ impl Backend for Pprof<'_> {
142146
}
143147

144148
impl Pprof<'_> {
149+
/// Workaround for pprof-rs to interupt the profiler
145150
pub fn dump_report(&self) -> Result<()> {
146151
let report = self
147152
.guard

0 commit comments

Comments
 (0)