Skip to content

Commit e579e2a

Browse files
committed
flamegraphs, use None validation, kademlia cfgs
1 parent 97782e1 commit e579e2a

File tree

11 files changed

+1086
-35
lines changed

11 files changed

+1086
-35
lines changed

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/target
2-
.env*
3-
!.env.example
42
.vscode
53
.DS_Store
6-
/qdrant_storage
4+
5+
# ignore all env except example
6+
.env*
7+
!.env.example
8+
9+
10+
flamegraph.svg

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ edition = "2021"
55
license = "Apache-2.0"
66
readme = "README.md"
77

8+
[profile.profiling]
9+
inherits = "release"
10+
debug = true
11+
812
[dependencies]
913
tokio-util = { version = "0.7.10", features = ["rt"] }
1014
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal"] }
@@ -58,6 +62,7 @@ libp2p-identity = { version = "0.2.9", features = ["secp256k1", "ed25519"] }
5862
tracing = { version = "0.1.40" }
5963
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
6064
public-ip = "0.2.2"
65+
dotenvy = "0.15.7"
6166

6267

6368
[dev-dependencies]

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ ifneq (,$(wildcard ./.env))
55
endif
66

77
###############################################################################
8-
.PHONY: launch # | Run with INFO log-level & release mode
8+
.PHONY: launch # | Run with INFO log-level in release mode
99
launch:
10-
RUST_LOG=info cargo run --release
11-
10+
RUST_LOG=warn,dkn_compute=info cargo run --release
11+
1212
.PHONY: run # | Run with INFO log-level
1313
run:
14-
RUST_LOG=none,dkn_compute=info cargo run
14+
RUST_LOG=warn,dkn_compute=info cargo run
1515

1616
.PHONY: debug # | Run with DEBUG log-level with INFO log-level workflows
1717
debug:
18-
RUST_LOG=none,dkn_compute=debug,ollama_workflows=info cargo run
18+
RUST_LOG=warn,dkn_compute=debug,ollama_workflows=info cargo run
1919

2020
.PHONY: trace # | Run with crate-level TRACE logging
2121
trace:
@@ -25,6 +25,10 @@ trace:
2525
build:
2626
cargo build
2727

28+
.PHONY: profile # | Profile with flamegraph at dev level
29+
profile:
30+
cargo flamegraph --root --profile=profiling
31+
2832
.PHONY: version # | Print version
2933
version:
3034
@cargo pkgid | cut -d@ -f2

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,20 @@ make lint # clippy
336336
make format # rustfmt
337337
```
338338

339+
### Profiling
340+
341+
To create a flamegraph of the application, do:
342+
343+
```sh
344+
make profile
345+
```
346+
347+
This will create a profiling build that inherits `release` mode, except with debug information.
348+
349+
> [!NOTE]
350+
>
351+
> Profiling requires superuser access.
352+
339353
## License
340354

341355
This project is licensed under the [Apache License 2.0](https://opensource.org/license/Apache-2.0).

0 commit comments

Comments
 (0)