We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fcfd09 commit 87f519bCopy full SHA for 87f519b
crates/node/src/pprof.rs
@@ -191,17 +191,7 @@ impl PprofConfig {
191
match report.pprof() {
192
Ok(profile) => {
193
// The profile object needs to be converted to bytes
194
- let body = match profile.write_to_bytes() {
195
- Ok(bytes) => bytes,
196
- Err(e) => {
197
- error!("Failed to encode profile: {}", e);
198
- let error_msg = format!("Failed to encode profile: {}", e);
199
- return Ok(Response::builder()
200
- .status(StatusCode::INTERNAL_SERVER_ERROR)
201
- .body(Full::new(Bytes::from(error_msg)))
202
- .unwrap());
203
- }
204
- };
+ let body: Vec<u8> = profile.encode_to_vec();
205
206
info!("Successfully collected CPU profile ({} bytes)", body.len());
207
0 commit comments