(
request_id: Option<i64>, class_name: &str, function_name: &str, remote_peer: &str,
tag_info: &TagInfo<'_>, key: Option<&str>,
)
| 341 | } |
| 342 | |
| 343 | fn create_exit_span( |
| 344 | request_id: Option<i64>, class_name: &str, function_name: &str, remote_peer: &str, |
| 345 | tag_info: &TagInfo<'_>, key: Option<&str>, |
| 346 | ) -> anyhow::Result<Span> { |
| 347 | RequestContext::try_with_global_ctx(request_id, |ctx| { |
| 348 | let mut span = |
| 349 | ctx.create_exit_span(&format!("{}->{}", class_name, function_name), remote_peer); |
| 350 | |
| 351 | let span_object = span.span_object_mut(); |
| 352 | span_object.set_span_layer(SpanLayer::Cache); |
| 353 | span_object.component_id = COMPONENT_PHP_MEMCACHED_ID; |
| 354 | span_object.add_tag(TAG_CACHE_TYPE, "memcache"); |
| 355 | if let Some(cmd) = tag_info.cmd { |
| 356 | span_object.add_tag(TAG_CACHE_CMD, cmd); |
| 357 | } |
| 358 | if let Some(op) = &tag_info.op { |
| 359 | span_object.add_tag(TAG_CACHE_OP, op.to_string()); |
| 360 | }; |
| 361 | if let Some(key) = key { |
| 362 | span_object.add_tag(TAG_CACHE_KEY, key) |
| 363 | } |
| 364 | |
| 365 | Ok(span) |
| 366 | }) |
| 367 | } |
| 368 | |
| 369 | fn get_peer(this: &mut ZObj, key: ZVal) -> String { |
| 370 | let f = || { |
no test coverage detected