https://github.com/tony-go/log-parser
Log parser (exercice from Rust in action book)
https://github.com/tony-go/log-parser
Last synced: 9 days ago
JSON representation
Log parser (exercice from Rust in action book)
- Host: GitHub
- URL: https://github.com/tony-go/log-parser
- Owner: tony-go
- Created: 2022-07-02T21:35:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-05T17:30:48.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T15:30:16.227Z (3 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#log-parser
👋🏼 Hi, during my Rust learning journey I'm trying to publish all my exercises.
`log-parser` is a function that take v8 GC logs as input and parse it.
## Install
Requirements:
- rust
- cargo```bash
$ cargo build
```## Run
### Parse logs from a file
```bash
$ cargo run -- --path
```Example:
```bash
$ cargo run -- --path ./gc-log.txt
```Will output:
```bash
cargo run -- --path gc-log.txt
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/log-parser --path gc-log.txt`
GcStats { phase: Scavenge, timing: Ok("44 ms"), body: "2.3 (3.0) -> 1.9 (4.0) MB, 1.2 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure" }
GcStats { phase: MarkSweep, timing: Ok("83 ms"), body: "2.3 (3.0) -> 1.9 (4.0) MB, 1.2 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure" }
GcStats { phase: MarkCompact, timing: Ok("144 ms"), body: "2.3 (3.0) -> 1.9 (4.0) MB, 1.2 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure" }
```