Skip to content

Commit 2ec1404

Browse files
author
Ariel Ben-Yehuda
committed
feat: add decoder implementation
1 parent f532aae commit 2ec1404

File tree

9 files changed

+1669
-16
lines changed

9 files changed

+1669
-16
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build (decoder)
2+
on: [pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
RUST_BACKTRACE: 1
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: dtolnay/rust-toolchain@master
12+
with:
13+
toolchain: stable
14+
- uses: Swatinem/rust-cache@v2
15+
with:
16+
cache-directories: decoder
17+
- name: Build
18+
working-directory: decoder
19+
shell: bash
20+
run: cargo build --all-features --verbose
21+
- name: Run tests
22+
working-directory: decoder
23+
shell: bash
24+
run: cargo test --all-features --verbose

.github/workflows/format.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
id: cargoFmt
1616
shell: bash
1717
run: cargo fmt --all -- --check
18+
- name: Run fmt check - decoder
19+
id: cargoFmtDecoder
20+
shell: bash
21+
working-directory: decoder
22+
run: cargo fmt --all -- --check
1823
clippy:
1924
name: Cargo clippy
2025
runs-on: ubuntu-latest
@@ -26,3 +31,17 @@ jobs:
2631
id: cargoClippy
2732
shell: bash
2833
run: cargo clippy --workspace --all-features -- -D warnings
34+
clippyDecoder:
35+
name: Cargo clippy (decoder)
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: dtolnay/rust-toolchain@stable
40+
- uses: Swatinem/rust-cache@v2
41+
with:
42+
cache-directories: decoder
43+
- name: Run clippy check - decoder
44+
id: cargoClippyDecoder
45+
shell: bash
46+
working-directory: decoder
47+
run: cargo clippy --workspace --all-features -- -D warnings

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
/decoder/target

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Then make a new PR for the release and get it approved.
5757

5858
The automated release PR generation functionality is not used here.
5959

60-
This requires a crates.io token in GitHub secrets for the repo. Currently the "token" is literally the string `secret` but I will put a more realistic token once the repo is public.
61-
6260
[conventional commits]: https://www.conventionalcommits.org/en/v1.0.0/
6361

6462
## Code of Conduct

Cargo.lock

Lines changed: 13 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ emit `tokio.PollCatchV1` events this way:
8484
}
8585
```
8686

87+
## Decoder
88+
89+
The `decoder` directory in the Git repository contains a decoder that can be used to view JFR files, especially with PollCatch information.
90+
91+
The decoder is NOT intended right now to be used in production. In particular, it uses the [`jfrs`] crate for parsing `.jfr` files, and while that crate seems to be purely safe Rust, to my knowledge it has not been audited for security and probably contains at least denial-of-service issues if not worse.
92+
93+
If you want to use the decoder for anything but debugging on trusted `.jfr` files, you bear full responsibility for the consequences.
94+
95+
[`jfrs`]: https://docs.rs/jfrs
96+
8797
## Security
8898

8999
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

0 commit comments

Comments
 (0)