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

Method new

src/adapter/src/statement_logging.rs:390–398  ·  view source on GitHub ↗

Create a new throttling state.

(now: &NowFn)

Source from the content-addressed store, hash-verified

388impl ThrottlingState {
389 /// Create a new throttling state.
390 pub fn new(now: &NowFn) -> Self {
391 Self {
392 inner: Mutex::new(ThrottlingStateInner {
393 tokens: 0,
394 last_logged_ts_seconds: now() / 1000,
395 }),
396 throttled_count: std::sync::atomic::AtomicUsize::new(0),
397 }
398 }
399
400 /// Check if we need to drop a statement due to throttling, and update the number of available
401 /// tokens appropriately.

Callers

nothing calls this directly

Calls 13

nowFunction · 0.85
transitive_usesMethod · 0.80
itemMethod · 0.80
latest_global_idMethod · 0.80
flat_mapMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
idMethod · 0.45
get_entryMethod · 0.45
extendMethod · 0.45
global_idsMethod · 0.45

Tested by

no test coverage detected