(this: &mut ZObj)
| 272 | } |
| 273 | |
| 274 | fn get_peer(this: &mut ZObj) -> String { |
| 275 | let handle = this.handle(); |
| 276 | |
| 277 | PEER_MAP |
| 278 | .entry(handle) |
| 279 | .or_insert_with(|| { |
| 280 | debug!( |
| 281 | handle, |
| 282 | "start to call {:?}::getExtendedStats method", |
| 283 | this.get_class().get_name() |
| 284 | ); |
| 285 | let stats = match this.call("getExtendedStats", []) { |
| 286 | Ok(stats) => stats, |
| 287 | Err(err) => { |
| 288 | error!( |
| 289 | ?err, |
| 290 | "call {:?}::getExtendedStats method failed", |
| 291 | this.get_class().get_name() |
| 292 | ); |
| 293 | return "".to_owned(); |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | stats |
| 298 | .as_z_arr() |
| 299 | .map(|arr| { |
| 300 | arr.iter() |
| 301 | .map(|(key, _)| match key { |
| 302 | IterKey::Index(i) => i.to_string(), |
| 303 | IterKey::ZStr(s) => s.to_str().unwrap_or_default().to_string(), |
| 304 | }) |
| 305 | .collect::<Vec<_>>() |
| 306 | .join(",") |
| 307 | }) |
| 308 | .unwrap_or_default() |
| 309 | }) |
| 310 | .value() |
| 311 | .clone() |
| 312 | } |
| 313 | |
| 314 | fn get_tag_key(class_name: Option<&str>, function_name: &str) -> String { |
| 315 | match class_name { |
no outgoing calls
no test coverage detected