(
&self, class_name: Option<String>, function_name: String, style: ApiStyle,
)
| 191 | |
| 192 | #[instrument(skip_all)] |
| 193 | fn hook_memcache_key_methods( |
| 194 | &self, class_name: Option<String>, function_name: String, style: ApiStyle, |
| 195 | ) -> (Box<BeforeExecuteHook>, Box<AfterExecuteHook>) { |
| 196 | ( |
| 197 | Box::new(move |request_id, execute_data| { |
| 198 | let tag_info = MEMCACHE_KEY_METHOD_MAPPING |
| 199 | .get(&*get_tag_key(class_name.as_deref(), &function_name)) |
| 200 | .unwrap(); |
| 201 | |
| 202 | let key = style |
| 203 | .get_mut_parameter(execute_data, 0) |
| 204 | .as_z_str() |
| 205 | .and_then(|s| s.to_str().ok()) |
| 206 | .map(ToOwned::to_owned) |
| 207 | .unwrap_or_default(); |
| 208 | |
| 209 | let this = style.get_this_mut(execute_data)?; |
| 210 | let peer = get_peer(this); |
| 211 | |
| 212 | let span = create_exit_span( |
| 213 | style, |
| 214 | request_id, |
| 215 | class_name.as_deref(), |
| 216 | &function_name, |
| 217 | &peer, |
| 218 | tag_info, |
| 219 | Some(&key), |
| 220 | )?; |
| 221 | |
| 222 | Ok(Box::new(span)) |
| 223 | }), |
| 224 | Box::new(after_hook), |
| 225 | ) |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | #[instrument(skip_all)] |
no test coverage detected