Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9ec7b96
wip(gem): various adjustments to Rubygem
omarabid Jun 13, 2022
d85d52c
wip: remove fiddle dependency
omarabid Jun 13, 2022
65c6f16
wip: add auth_token support
omarabid Jun 13, 2022
bdb93c4
wip: version bump
omarabid Jun 13, 2022
e9c2b8c
wip: remove Cargo.lock files
omarabid Jun 17, 2022
d68275b
wip: add cbindgen for rbspy/thread_id extensions
omarabid Jun 18, 2022
98d2246
wip: python wheels
omarabid Jun 18, 2022
e7781f7
wip: minor modifications
omarabid Jun 20, 2022
a2ebe18
wip: cargo patch
omarabid Jun 21, 2022
bdecaa1
fix(lib): fixed an obsecure bug when counting stacktraces
omarabid Jun 21, 2022
bd44e0a
wip: rbspy backend with patched oncpu
omarabid Jun 22, 2022
1a2e6f1
wip: add oncpu/native/gil_only options
omarabid Jun 22, 2022
4a1e1df
wip(python): add auth_token support
omarabid Jun 22, 2022
c3fb878
wip(python): name change
omarabid Jun 22, 2022
ccdf167
wip(python): bump version
omarabid Jun 22, 2022
0a15452
fix(pyspy): add read-process-memory patched crate
omarabid Jun 24, 2022
353a51e
wip: stash
omarabid Jun 25, 2022
c877041
imp(backend): add Backend extension to application_name
omarabid Jun 25, 2022
e8a0274
imp(backend): add BackendConfig
omarabid Jun 25, 2022
8403042
imp(pprof): implement BackendConfig for pprof-rs and add example
omarabid Jun 26, 2022
0bbbbb3
imp(rbspy): add BackendConfig support
omarabid Jun 27, 2022
555dd25
Merge branch 'rubygem' into 0.5.3
omarabid Jun 27, 2022
ad34c2c
imp(pyspy): add spy extension
omarabid Jun 27, 2022
09fcf6d
merge from oncpu
omarabid Jun 27, 2022
24b29df
refactor(rbspy): remove report_thread_name
omarabid Jun 27, 2022
284dcbb
Merge branch 'release-python' into 0.5.3
omarabid Jun 27, 2022
cc2f090
imp(pyspy): add BackendConfig support
omarabid Jun 27, 2022
cf39992
imp(pprof): update pprof-rs version
omarabid Jun 27, 2022
1aef9aa
refactor(rbspy): use forked upstream crate
omarabid Jun 27, 2022
84d21df
chore(docs): add CONTRIBUTING guideline
omarabid Jun 27, 2022
cea870a
chore(docs): add PR template
omarabid Jun 27, 2022
53ad880
chore(ops): add dependabot config
omarabid Jun 27, 2022
fdef71b
refactor(cargo): remove patch section from main Cargo.toml file
omarabid Jun 27, 2022
eaff8c0
chore(release): lib-0.5.3 release
omarabid Jun 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
Thanks for helping out!

Please link the appropriate issue from your PR.

If you don't have an issue, we'd recommend starting with one first so the PR can focus on the
implementation (unless its an obvious bug or documentation fix that will have
little conversation).
-->
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
time: "07:00"
open-pull-requests-limit: 10
labels:
- C-dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- "C-dependencies"
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# v0.5.3
## New features
- Add BackendConfig to make reporting of pid, thread_id and thread_name
optional.
- Backends can add a suffix to the "application_name"

## Bug Fixes
- **main**: fixed an obsecure bug when counting stacktraces ([Abid Omar](https://github.com/pyroscope-io/pyroscope-rs/commit/bdecaa13aeae3ce7d4c3d97f88bdd104ec35e7c5))

# v0.5.2
## New features
- Authentication Token support
Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing to Pyroscope

Thank you for your interest in contributing to Pyroscope! We welcome all people who want to contribute in a healthy and constructive manner within our community. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).

This document is a guide to help you through the process of contributing to Pyroscope.

## Where do I start

* Set up your [development environment](https://pyroscope.io/docs/developer-guide).
* Read the [style guides](https://pyroscope.io/docs/style-guide) we use.
* Check out the list of [good first issues](https://github.com/pyroscope-io/pyroscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pyroscope Profiler Agent for continuous profiling of Rust, Python and Ruby appli
"""
keywords = ["pyroscope", "profiler", "profiling", "pprof"]
authors = ["Abid Omar <contact@omarabid.com>"]
version = "0.5.2"
version = "0.5.3"
edition = "2021"
license = "Apache-2.0"
homepage = "https://pyroscope.io/docs/rust"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
pyroscope = "0.5.2"
pyroscope = "0.5.3"
pyroscope_pprofrs = "0.2"
```

Expand Down
128 changes: 128 additions & 0 deletions examples/multi-thread-report.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
extern crate pyroscope;

use pyroscope::{PyroscopeAgent, Result};
use pyroscope_pprofrs::{pprof_backend, PprofConfig};
use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
thread,
};

fn hash_rounds1(n: u64) -> u64 {
let hash_str = "Some string to hash";
let mut default_hasher = DefaultHasher::new();

for _ in 0..n {
for _ in 0..1000 {
default_hasher.write(hash_str.as_bytes());
}
hash_str.hash(&mut default_hasher);
}

n
}

fn hash_rounds2(n: u64) -> u64 {
let hash_str = "Some string to hash";
let mut default_hasher = DefaultHasher::new();

for _ in 0..n {
for _ in 0..1000 {
default_hasher.write(hash_str.as_bytes());
}
hash_str.hash(&mut default_hasher);
}

n
}

fn extra_rounds1(n: u64) -> u64 {
let hash_str = "Some string to hash";
let mut default_hasher = DefaultHasher::new();

for _ in 0..n {
for _ in 0..1000 {
default_hasher.write(hash_str.as_bytes());
}
hash_str.hash(&mut default_hasher);
}

n
}

fn extra_rounds2(n: u64) -> u64 {
let hash_str = "Some string to hash";
let mut default_hasher = DefaultHasher::new();

for _ in 0..n {
for _ in 0..1000 {
default_hasher.write(hash_str.as_bytes());
}
hash_str.hash(&mut default_hasher);
}

n
}

fn main() -> Result<()> {
let agent = PyroscopeAgent::builder("http://localhost:4040", "example.multithread.report")
.tags([("Host", "Rust")].to_vec())
.backend(pprof_backend(
PprofConfig::new()
.sample_rate(100)
.report_thread_id()
.report_thread_name(),
))
.build()?;

// Show start time
let start = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_secs();
println!("Start Time: {}", start);

// Start Agent
let agent_running = agent.start()?;

let (add_tag, remove_tag) = agent_running.tag_wrapper();

let handle_1 = thread::Builder::new()
.name("thread-1".to_string())
.spawn(move || {
hash_rounds1(300_000);
add_tag("extra".to_string(), "round-1".to_string()).unwrap();
extra_rounds1(200_000);
remove_tag("extra".to_string(), "round-1".to_string()).unwrap();
})?;

let (add_tag, remove_tag) = agent_running.tag_wrapper();

let handle_2 = thread::Builder::new()
.name("thread-2".to_string())
.spawn(move || {
add_tag("extra".to_string(), "round-2".to_string()).unwrap();
extra_rounds2(100_000);
remove_tag("extra".to_string(), "round-2".to_string()).unwrap();
hash_rounds2(500_000);
})?;

// Wait for the threads to complete
handle_1.join().unwrap();
handle_2.join().unwrap();

// Stop Agent
let agent_ready = agent_running.stop()?;

// Shutdown the Agent
agent_ready.shutdown();

// Show program exit time
let exit = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_secs();
println!("Exit Time: {}", exit);

Ok(())
}
2 changes: 1 addition & 1 deletion pyroscope_backends/pyroscope_pprofrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ readme = "README.md"


[dependencies]
pprof = "0.9.1"
pprof = "0.10.0"
pyroscope = {version = "0.5.2", path = "../../" }
thiserror ="1.0"

Expand Down
Loading