(
client: &SessionClient,
instance_id: Option<ComputeInstanceId>,
strategy: Option<StatementExecutionStrategy>,
)
| 1621 | } |
| 1622 | |
| 1623 | fn histogram( |
| 1624 | client: &SessionClient, |
| 1625 | instance_id: Option<ComputeInstanceId>, |
| 1626 | strategy: Option<StatementExecutionStrategy>, |
| 1627 | ) -> Histogram { |
| 1628 | let session = client.session.as_ref().expect("session invariant"); |
| 1629 | let isolation_level = *session.vars().transaction_isolation(); |
| 1630 | let name_hint = ApplicationNameHint::from_str(session.application_name()); |
| 1631 | let instance = match instance_id { |
| 1632 | Some(i) => Cow::Owned(i.to_string()), |
| 1633 | None => Cow::Borrowed("none"), |
| 1634 | }; |
| 1635 | let strategy = match strategy { |
| 1636 | Some(s) => s.name(), |
| 1637 | None => "none", |
| 1638 | }; |
| 1639 | |
| 1640 | client |
| 1641 | .inner() |
| 1642 | .metrics() |
| 1643 | .time_to_first_row_seconds |
| 1644 | .with_label_values(&[ |
| 1645 | instance.as_ref(), |
| 1646 | isolation_level.as_variant_str(), |
| 1647 | strategy, |
| 1648 | name_hint.as_str(), |
| 1649 | ]) |
| 1650 | } |
| 1651 | |
| 1652 | /// If you want to match [`RecordFirstRowStream`]'s logic but don't need |
| 1653 | /// a UnboundedReceiver, you can tell it when to record an observation. |
nothing calls this directly
no test coverage detected