MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / histogram

Method histogram

src/adapter/src/client.rs:1623–1650  ·  view source on GitHub ↗
(
        client: &SessionClient,
        instance_id: Option<ComputeInstanceId>,
        strategy: Option<StatementExecutionStrategy>,
    )

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 11

expectMethod · 0.80
transaction_isolationMethod · 0.80
as_variant_strMethod · 0.80
as_refMethod · 0.45
varsMethod · 0.45
application_nameMethod · 0.45
to_stringMethod · 0.45
nameMethod · 0.45
metricsMethod · 0.45
innerMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected