Update last-active timestamp and increment byte counters.
(&self, session_id: &str, bytes_in_delta: u64, bytes_out_delta: u64)
| 252 | |
| 253 | /// Update last-active timestamp and increment byte counters. |
| 254 | pub fn touch_with_bytes(&self, session_id: &str, bytes_in_delta: u64, bytes_out_delta: u64) { |
| 255 | let now = now_secs(); |
| 256 | let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner()); |
| 257 | if let Some(s) = sessions.get(session_id) { |
| 258 | s.last_active.store(now, Ordering::Relaxed); |
| 259 | s.bytes_in.fetch_add(bytes_in_delta, Ordering::Relaxed); |
| 260 | s.bytes_out.fetch_add(bytes_out_delta, Ordering::Relaxed); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /// Set the current statement digest for a session. |
| 265 | pub fn set_current_statement(&self, session_id: &str, digest: String) { |