删除无用字段

This commit is contained in:
xiuting.xu 2026-06-25 14:37:19 +08:00
parent b105b3b7d0
commit cc3518897f
4 changed files with 3 additions and 14 deletions

View File

@ -563,15 +563,13 @@ fn log_cache_memory_stats(phase: &str, shared_cache: &SharedRtrCache, notifier:
let rss_mib = current_rss_mib(); let rss_mib = current_rss_mib();
info!( info!(
"RTR memory observe: phase={}, listener_count={}, serials={:?}, snapshot_payload_counts={:?}, delta_lengths={:?}, delta_payload_counts={:?}, snapshot_arc_strong_counts={:?}, rtr_payloads_arc_strong_counts={:?}, rss_mib={:?}", "RTR memory observe: phase={}, listener_count={}, serials={:?}, snapshot_payload_counts={:?}, delta_lengths={:?}, delta_payload_counts={:?}, rss_mib={:?}",
phase, phase,
notifier.listener_count(), notifier.listener_count(),
stats.serials, stats.serials,
stats.snapshot_payload_counts, stats.snapshot_payload_counts,
stats.delta_lengths, stats.delta_lengths,
stats.delta_payload_counts, stats.delta_payload_counts,
stats.snapshot_arc_strong_counts,
stats.rtr_payloads_arc_strong_counts,
rss_mib rss_mib
); );
} }

View File

@ -741,8 +741,6 @@ pub struct CacheMemoryStats {
pub snapshot_payload_counts: [usize; VERSION_COUNT], pub snapshot_payload_counts: [usize; VERSION_COUNT],
pub delta_lengths: [usize; VERSION_COUNT], pub delta_lengths: [usize; VERSION_COUNT],
pub delta_payload_counts: [usize; VERSION_COUNT], pub delta_payload_counts: [usize; VERSION_COUNT],
pub snapshot_arc_strong_counts: [usize; VERSION_COUNT],
pub rtr_payloads_arc_strong_counts: [usize; VERSION_COUNT],
} }
#[derive(Debug, Clone, Copy, Default, Serialize)] #[derive(Debug, Clone, Copy, Default, Serialize)]
@ -817,18 +815,11 @@ impl RtrCache {
.map(|delta| delta.announced().len() + delta.withdrawn().len()) .map(|delta| delta.announced().len() + delta.withdrawn().len())
.sum() .sum()
}); });
let snapshot_arc_strong_counts =
std::array::from_fn(|idx| Arc::strong_count(&self.versions[idx].snapshot));
let rtr_payloads_arc_strong_counts =
std::array::from_fn(|idx| Arc::strong_count(&self.versions[idx].rtr_payloads));
CacheMemoryStats { CacheMemoryStats {
serials: self.serials(), serials: self.serials(),
snapshot_payload_counts, snapshot_payload_counts,
delta_lengths, delta_lengths,
delta_payload_counts, delta_payload_counts,
snapshot_arc_strong_counts,
rtr_payloads_arc_strong_counts,
} }
} }

View File

@ -406,7 +406,7 @@ impl ReportContext {
let max_connections = service_stats.max_connections(); let max_connections = service_stats.max_connections();
let generated_at = self.report_now(timezone); let generated_at = self.report_now(timezone);
let metadata = ReportMetadata { let metadata = ReportMetadata {
schema_version: 2, schema_version: 1,
generated_at, generated_at,
phase: phase.to_string(), phase: phase.to_string(),
}; };

View File

@ -44,7 +44,7 @@ fn write_report_creates_parseable_json() {
); );
let source_report = read_single_report(&report_dir, "rtr-source"); let source_report = read_single_report(&report_dir, "rtr-source");
assert_eq!(source_report["schema_version"], 2); assert_eq!(source_report["schema_version"], 1);
assert_eq!(source_report["phase"], "test"); assert_eq!(source_report["phase"], "test");
assert_report_time_offset(&source_report["generated_at"]); assert_report_time_offset(&source_report["generated_at"]);
assert_report_time_offset(&source_report["cache"]["created_at"]); assert_report_time_offset(&source_report["cache"]["created_at"]);