MCPcopy Create free account
hub / github.com/apache/skywalking-php / hook_memcache_key_methods

Method hook_memcache_key_methods

src/plugin/plugin_memcache.rs:193–226  ·  view source on GitHub ↗
(
        &self, class_name: Option<String>, function_name: String, style: ApiStyle,
    )

Source from the content-addressed store, hash-verified

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)]

Callers 1

hookMethod · 0.80

Calls 5

get_tag_keyFunction · 0.85
get_mut_parameterMethod · 0.80
get_this_mutMethod · 0.80
get_peerFunction · 0.70
create_exit_spanFunction · 0.70

Tested by

no test coverage detected