Skip to content

Commit 6d6d022

Browse files
authored
Merge pull request #7 from omarabid/main
Pre-release
2 parents b02aa89 + 065c596 commit 6d6d022

File tree

17 files changed

+144
-89
lines changed

17 files changed

+144
-89
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
publish-pyroscope:
10+
name: Publish pyroscope crate
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions-rs/toolchain@v1
15+
with:
16+
toolchain: stable
17+
override: true
18+
- name: publish pyroscope crate
19+
continue-on-error: true
20+
run: |
21+
cargo login ${{ secrets.CARGO_TOKEN }}
22+
cargo publish

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Pre-Release
2+
3+
on: [push]
4+
5+
jobs:
6+
release:
7+
name: Create draft release
8+
runs-on: ubuntu-latest
9+
if: "startsWith(github.ref, 'refs/tags/')"
10+
steps:
11+
- uses: "marvinpinto/[email protected]"
12+
with:
13+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
14+
draft: true
15+
prerelease: false

examples/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async fn main() -> Result<()> {
2929
.build()?;
3030

3131
// Start Agent
32-
agent.start()?;
32+
agent.start();
3333

3434
tokio::task::spawn(async {
3535
let n = fibonacci1(45);
@@ -46,7 +46,7 @@ async fn main() -> Result<()> {
4646
.unwrap();
4747

4848
// Stop Agent
49-
agent.stop()?;
49+
agent.stop();
5050

5151
Ok(())
5252
}

examples/backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ fn main() -> Result<()> {
2323
.tags(&[("TagA", "ValueA"), ("TagB", "ValueB")])
2424
.build()?;
2525

26-
agent.start()?;
26+
agent.start();
2727
let _result = fibonacci(45);
28-
agent.stop()?;
28+
agent.stop();
2929

3030
Ok(())
3131
}

examples/basic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() -> Result<()> {
2828
println!("Start Time: {}", start);
2929

3030
// Start Agent
31-
agent.start()?;
31+
agent.start();
3232

3333
let _result = fibonacci(47);
3434

@@ -40,7 +40,7 @@ fn main() -> Result<()> {
4040
println!("Stop Time: {}", stop);
4141

4242
// Stop Agent
43-
agent.stop()?;
43+
agent.stop();
4444

4545
drop(agent);
4646

examples/error.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,22 @@ fn fibonacci(n: u64) -> u64 {
1616
}
1717

1818
fn main() -> Result<()> {
19-
// Force rustc to display the log messages in the console.
19+
// Force rustc to display the log messages in the console.
2020
std::env::set_var("RUST_LOG", "trace");
2121

2222
// Initialize the logger.
2323
pretty_env_logger::init_timed();
2424

25-
// This example should fail and return an error.
26-
println!("This example should fail and return an error.");
27-
println!("Run this with: RUST_BACKTRACE=1 cargo run --example error");
28-
2925
let mut agent = PyroscopeAgent::builder("http://invalid_url", "example.error")
30-
.build()?;
26+
.build()
27+
.unwrap();
3128
// Start Agent
32-
agent.start()?;
29+
agent.start();
3330

3431
let _result = fibonacci(47);
3532

3633
// Stop Agent
37-
agent.stop()?;
34+
agent.stop();
3835

3936
drop(agent);
4037

examples/multi-thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() -> Result<()> {
3030
.build()?;
3131

3232
// Start Agent
33-
agent.start()?;
33+
agent.start();
3434

3535
let handle_1 = thread::spawn(|| {
3636
fibonacci1(45);
@@ -45,7 +45,7 @@ fn main() -> Result<()> {
4545
handle_2.join().unwrap();
4646

4747
// Stop Agent
48-
agent.stop()?;
48+
agent.stop();
4949

5050
Ok(())
5151
}

examples/tags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() -> Result<()> {
2222
.build()?;
2323

2424
// Start Agent
25-
agent.start()?;
25+
agent.start();
2626

2727
// Make some calculation
2828
let _result = fibonacci(47);
@@ -34,7 +34,7 @@ fn main() -> Result<()> {
3434
let _result = fibonacci(47);
3535

3636
// Stop Agent
37-
agent.stop()?;
37+
agent.stop();
3838

3939
Ok(())
4040
}

examples/with-logger.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ fn main() -> Result<()> {
3030
let mut agent = PyroscopeAgent::builder("http://localhost:4040", "example.logger").build()?;
3131

3232
// Start Agent
33-
agent.start()?;
33+
agent.start();
3434

3535
let _result = fibonacci(47);
3636

3737
// Stop Agent
38-
agent.stop()?;
38+
agent.stop();
3939

4040
Ok(())
4141
}

src/backends/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::Result;
88

99
use std::fmt::Debug;
1010

11-
/// Backend State
11+
/// Backend State
1212
#[derive(Debug, Clone, Copy, PartialEq)]
1313
pub enum State {
1414
/// Backend is uninitialized.

0 commit comments

Comments
 (0)