Skip to content

Commit efbf7fc

Browse files
authored
Add Profiling Support for Indexer/tap-agent services (#704)
* feat(docker): Add continuous profiling with embedded pprof and external tools - Embedded continuous profiling using pprof in Rust code - External tools: flamegraph, valgrind, callgrind, strace - Docker support for all profiling methods - Just commands for easy profiling management Flamegraphs and profiles are saved to contrib/profiling/output. * feat(indexer): Integrate pprof tool into service binary * feat(gitignore): Ignore profiling files * feat(profiling): Integrate profiling into tap-agent service * feat(profiling): Integrate pprof into tap-agent binary * refactor(profiling): extract profiling into dedicated crate Move duplicated profiling functionality from multiple crates into a single shared 'profiler' crate. Key changes: - Create new 'profiler' crate with optimized implementation - Use AtomicU64 instead of Mutex for snapshot counter - Add proper error handling with thiserror - Ensure proper directory structure for profiling output - Make profiling opt-in via a feature flag * fix(profiler): Add missing script to setup profiling * fix(docker): Fix base image for profiling * fix(justfile): Add tap-agent * chore(cargo): Add debug symbols comment * chore(cargo): Add comment to enable debug symbols * feat(profiler): Use human readable date/time * feat(profiler): Enable other callgrind options * chore(code): Some cleanups * feat(profiler): Add profiling instructions * fix(profiler): Fix doctest documentation in profiler * fix(test): Disable profiling in cargo test
1 parent 6e49c0c commit efbf7fc

22 files changed

+1175
-23
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ crates/dips/node_modules/
1717
crates/dips/generated/
1818
crates/dips/npm-debug.log*
1919
contrib/local-network
20+
contrib/profiling/indexer-service
21+
contrib/profiling/tap-agent
2022
node_modules
2123
target/
2224
*.code-workspace

Cargo.lock

+217-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
"crates/dips",
77
"crates/indexer-receipt",
88
"crates/monitor",
9+
"crates/profiler",
910
"crates/query",
1011
"crates/service",
1112
"crates/tap-agent",
@@ -15,6 +16,13 @@ members = [
1516
]
1617
resolver = "2"
1718

19+
# This is to enable debug symbols
20+
# which are useful during profiling
21+
# with callgrind
22+
# [profile.release]
23+
# debug = true
24+
# force-frame-pointers = true
25+
1826
[profile.dev.package."*"]
1927
opt-level = 3
2028

0 commit comments

Comments
 (0)