MCPcopy Create free account
hub / github.com/AI45Lab/Code / tokens_used

Method tokens_used

core/src/ahp/runtime_state.rs:132–140  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

130 }
131
132 pub(super) fn tokens_used(&self) -> i32 {
133 if self.runtime_tokens_seen.load(Ordering::Relaxed) {
134 read_or_recover(&self.runtime_run_tokens)
135 .values()
136 .fold(0i32, |sum, tokens| sum.saturating_add(*tokens))
137 } else {
138 self.hook_token_fallback.load(Ordering::Relaxed)
139 }
140 }
141
142 fn add_runtime_turn_tokens(&self, run_id: &str, tokens: i32) {
143 self.mark_runtime_tokens_seen();

Callers 1

runtime_snapshotMethod · 0.80

Calls 2

read_or_recoverFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected