(
&self, function_name: &str,
)
| 115 | } |
| 116 | |
| 117 | fn hook_pdo_methods( |
| 118 | &self, function_name: &str, |
| 119 | ) -> (Box<BeforeExecuteHook>, Box<AfterExecuteHook>) { |
| 120 | let function_name = function_name.to_owned(); |
| 121 | ( |
| 122 | Box::new(move |request_id, execute_data| { |
| 123 | let handle = get_this_mut(execute_data)?.handle(); |
| 124 | |
| 125 | debug!(handle, function_name, "call PDO method"); |
| 126 | |
| 127 | let mut span = with_dsn(handle, |dsn| { |
| 128 | create_exit_span_with_dsn(request_id, "PDO", &function_name, dsn) |
| 129 | })?; |
| 130 | |
| 131 | if execute_data.num_args() >= 1 { |
| 132 | if let Some(statement) = execute_data.get_parameter(0).as_z_str() { |
| 133 | span.add_tag(TAG_DB_STATEMENT, statement.to_str()?); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | Ok(Box::new(span) as _) |
| 138 | }), |
| 139 | Box::new(after_hook), |
| 140 | ) |
| 141 | } |
| 142 | |
| 143 | fn hook_pdo_statement_methods( |
| 144 | &self, function_name: &str, |
no test coverage detected