Closed Doslin closed 1 year ago
I have exactly the same problem, does anyone know how to solve it?
Fix this issue by adding the protobuf-codec option to the features, like this:
pprof = { version = "0.11.1", features = ["flamegraph", "protobuf-codec"] }
But now it's telling me that the encode method does not exist in the profile object, does anyone know how to solve it?
I think this issue has already been fixed by https://github.com/tikv/pprof-rs/pull/208
In cargo projects, if you want to run an example, you can try cargo run --example exmaple_name
.
Then you will get the tips about how to enable features for this example.
➜ pprof-rs git:(master) ✗ cargo run --example profile_proto_with_prost
error: target `profile_proto_with_prost` in package `pprof` requires the features: `prost-codec`
Consider enabling them by passing, e.g., `--features="prost-codec"`
Then:
➜ pprof-rs git:(master) ✗ cargo run --example profile_proto_with_protobuf_codec --features="protobuf-codec"
Compiling memchr v2.5.0
Compiling io-lifetimes v1.0.9
Compiling rustix v0.36.11
Compiling pprof v0.11.1 (/Users/hi-rustin/vsc/pprof-rs)
Compiling once_cell v1.17.1
Compiling object v0.30.3
error[E0599]: no method named
pprof
found for structpprof::Report
in the current scope --> examples/profile_proto.rs:103:30 | 103 | let profile = report.pprof().unwrap(); | ^^^^^ method not found inpprof::Report
error[E0599]: no method named
pprof
found for structpprof::Report
in the current scope --> examples/profile_proto.rs:104:30 | 104 | let profile = report.pprof().unwrap(); | ^^^^^ method not found inpprof::Report
For more information about this error, try
rustc --explain E0599
. error: could not compilepprof
due to 2 previous errors