From f17f1f57f0961323d8d165515c736c822915d49f Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Mon, 7 Oct 2024 15:41:37 -0700 Subject: [PATCH] add debugging and keylogfile --- src/clients/cache/momento/http.rs | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/clients/cache/momento/http.rs b/src/clients/cache/momento/http.rs index 1736f1f..f1893b4 100644 --- a/src/clients/cache/momento/http.rs +++ b/src/clients/cache/momento/http.rs @@ -1,3 +1,4 @@ +use rustls::KeyLogFile; use crate::clients::common::*; use crate::workload::{ClientRequest, ClientWorkItemKind}; use crate::*; @@ -56,11 +57,13 @@ pub async fn pool_manager(endpoint: String, _config: Config, queue: Queue { let response = response.await; - let response = match response { + let mut response = match response { Ok(r) => r, Err(_e) => { GET_EX.increment(); @@ -188,14 +191,21 @@ async fn task( let status = response.status().as_u16(); + info!("get status: {status}"); + // read the response body to completion let mut buffer = BytesMut::new(); - let mut body = response.into_body(); + // let mut body = response.into_body(); - while let Some(chunk) = body.data().await { + while let Some(chunk) = response.body_mut().data().await { if let Ok(b) = chunk { + info!("chunk for get: {}", b.len()); buffer.extend_from_slice(&b); + + // if body.is_end_stream() { + // info!("end of stream"); + // } } else { GET_EX.increment(); @@ -205,6 +215,8 @@ async fn task( } } + info!("get complete"); + let latency = start.elapsed(); REQUEST_OK.increment(); @@ -269,7 +281,7 @@ async fn task( let response = match response { Ok(r) => r, Err(_e) => { - GET_EX.increment(); + SET_EX.increment(); RESPONSE_EX.increment(); @@ -279,6 +291,8 @@ async fn task( let status = response.status().as_u16(); + info!("set status: {status}"); + // read the response body to completion let mut buffer = BytesMut::new(); @@ -286,6 +300,7 @@ async fn task( while let Some(chunk) = body.data().await { if let Ok(b) = chunk { + info!("chunk for set: {}", b.len()); buffer.extend_from_slice(&b); } else { GET_EX.increment(); @@ -296,6 +311,8 @@ async fn task( } } + info!("set complete"); + let latency = start.elapsed(); REQUEST_OK.increment(); @@ -349,6 +366,8 @@ async fn task( let status = response.status().as_u16(); + info!("delete status: {status}"); + // read the response body to completion let mut buffer = BytesMut::new(); @@ -356,9 +375,10 @@ async fn task( while let Some(chunk) = body.data().await { if let Ok(b) = chunk { + info!("chunk for delete: {}", b.len()); buffer.extend_from_slice(&b); } else { - GET_EX.increment(); + DELETE_EX.increment(); RESPONSE_EX.increment(); @@ -366,6 +386,8 @@ async fn task( } } + info!("delete complete"); + let latency = start.elapsed(); REQUEST_OK.increment();