Release v1.5.5 parser SDK sync

This commit is contained in:
0xfnzero
2026-06-01 20:20:01 +08:00
parent 5a282bd84d
commit 83c5476ff3
45 changed files with 979 additions and 211 deletions
+2 -3
View File
@@ -69,8 +69,7 @@ pub fn parse_grpc_transaction_events(
let recv_us = transaction_pretty.recv_us;
let grpc_tx = transaction_pretty.grpc_tx;
let block_time_us = block_time.map(|t| t.seconds * 1_000_000 + t.nanos as i64 / 1_000);
let update =
SubscribeUpdateTransaction { slot, transaction: Some(grpc_tx), ..Default::default() };
let update = SubscribeUpdateTransaction { slot, transaction: Some(grpc_tx) };
let sdk_parse_filter = build_sdk_parse_event_filter(event_type_filter);
let sdk_events = parse_subscribe_update_transaction_low_latency(
&update,
@@ -116,7 +115,7 @@ pub async fn process_grpc_transaction(
AccountParseResult::Event(mut event) => {
event.metadata_mut().handle_us = elapsed_micros_since(account_pretty.recv_us);
let processing_time_us = event.metadata().handle_us as f64;
callback(event);
callback(*event);
update_metrics(MetricsEventType::Account, 1, processing_time_us);
return Ok(());
}
+8 -2
View File
@@ -194,6 +194,12 @@ impl PerformanceMetrics {
}
}
impl Default for PerformanceMetrics {
fn default() -> Self {
Self::new()
}
}
/// High-performance metrics system
#[derive(Debug)]
pub struct HighPerformanceMetrics {
@@ -525,7 +531,7 @@ impl MetricsManager {
let new_count = GLOBAL_METRICS.dropped_events_count.fetch_add(1, Ordering::Relaxed) + 1;
// 每丢弃1000个事件记录一次警告日志
if new_count % 1000 == 0 {
if new_count.is_multiple_of(1000) {
log::debug!("Dropped events count reached: {}", new_count);
}
}
@@ -547,7 +553,7 @@ impl MetricsManager {
}
// 每丢弃1000个事件记录一次警告日志
if new_count % 1000 == 0 || (new_count / 1000) != ((new_count - count) / 1000) {
if new_count.is_multiple_of(1000) || (new_count / 1000) != ((new_count - count) / 1000) {
log::debug!("Dropped events count reached: {}", new_count);
}
}