Merge pull request #150 from yenicelik/devel

some code got lost in all the commits, deploying again
This commit is contained in:
David 2023-06-25 21:03:48 -04:00 committed by GitHub
commit a9acd1279b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

@ -31,7 +31,7 @@ use std::num::NonZeroU64;
use std::str::FromStr;
use std::sync::atomic::{self, Ordering};
use std::sync::Arc;
use tracing::trace;
use tracing::{trace, warn};
pub use stat_buffer::{SpawnedStatBuffer, StatBuffer};
@ -199,6 +199,9 @@ impl BufferedRpcQueryStats {
self.sum_response_bytes += stat.response_bytes;
self.sum_response_millis += stat.response_millis;
self.sum_credits_used += stat.compute_unit_cost;
let latest_balance = stat.authorization.checks.latest_balance.read();
self.latest_balance = latest_balance.clone();
}
async fn _save_db_stats(
@ -723,8 +726,7 @@ impl BufferedRpcQueryStats {
builder = builder.tag("method", key.method);
// Read the latest balance ...
let remaining = self.latest_balance.read().remaining();
let remaining = self.latest_balance.remaining();
trace!("Remaining balance for influx is {:?}", remaining);
builder = builder

@ -29,7 +29,7 @@ pub struct BufferedRpcQueryStats {
pub sum_credits_used: Decimal,
pub sum_cu_used: Decimal,
/// The user's balance at this point in time. Multiple queries might be modifying it at once.
pub latest_balance: Arc<RwLock<Balance>>,
pub latest_balance: Balance,
}
#[derive(From)]