File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2021 Developers of Pyroscope.
2+
3+ // Licensed under the Apache License, Version 2.0 <LICENSE or
4+ // https://www.apache.org/licenses/LICENSE-2.0>. This file may not be copied, modified, or distributed
5+ // except according to those terms.
6+
7+ extern crate pyroscope;
8+
9+ use pyroscope:: { PyroscopeAgent , Result } ;
10+
11+ fn fibonacci ( n : u64 ) -> u64 {
12+ match n {
13+ 0 | 1 => 1 ,
14+ n => fibonacci ( n - 1 ) + fibonacci ( n - 2 ) ,
15+ }
16+ }
17+
18+ fn main ( ) -> Result < ( ) > {
19+ // This example should fail and return an error.
20+ let mut agent = PyroscopeAgent :: builder ( "http://invalid_url" , "example.error" )
21+ . build ( ) ?;
22+ // Start Agent
23+ agent. start ( ) ?;
24+
25+ let _result = fibonacci ( 47 ) ;
26+
27+ // Stop Agent
28+ agent. stop ( ) ?;
29+
30+ drop ( agent) ;
31+
32+ Ok ( ( ) )
33+ }
Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ impl SessionManager {
5454 }
5555 SessionSignal :: Kill => {
5656 // Kill the session manager
57- return Ok ( ( ) ) ;
5857 log:: trace!( "SessionManager - Kill signal received" ) ;
58+ return Ok ( ( ) ) ;
5959 }
6060 }
6161 }
You can’t perform that action at this time.
0 commit comments