Skip to content

Commit 701d54c

Browse files
committed
test logging
1 parent 657e639 commit 701d54c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/agent/services/lazer_exporter.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use {
33
anyhow::{
44
Context,
55
Result,
6-
anyhow,
76
bail,
87
},
98
backoff::{
@@ -351,7 +350,10 @@ mod lazer_exporter {
351350
},
352351
},
353352
std::{
354-
collections::HashMap,
353+
collections::{
354+
HashMap,
355+
HashSet,
356+
},
355357
sync::Arc,
356358
},
357359
tokio::sync::broadcast::Sender,
@@ -373,10 +375,19 @@ mod lazer_exporter {
373375
lazer_symbols.len(),
374376
&config.history_url
375377
);
378+
for symbol in lazer_symbols.iter() {
379+
tracing::info!(
380+
"history endpoint identifier: {:?} hex: {:?} symbol response: {:?}",
381+
symbol.0,
382+
symbol.0.to_hex(),
383+
symbol.1
384+
);
385+
}
376386

377387
let mut publish_interval = tokio::time::interval(config.publish_interval_duration);
378388
let mut symbol_fetch_interval =
379389
tokio::time::interval(config.symbol_fetch_interval_duration);
390+
let mut found_identifiers = HashSet::new();
380391

381392
loop {
382393
tokio::select! {
@@ -394,6 +405,11 @@ mod lazer_exporter {
394405

395406
// TODO: This read locks and clones local::Store::prices, which may not meet performance needs.
396407
for (identifier, price_info) in state.get_all_price_infos().await {
408+
if !found_identifiers.contains(&identifier) {
409+
tracing::info!("pythnet identifier: {:?} hex: {:?} price_info: {:?}", identifier, identifier.to_hex(), price_info);
410+
found_identifiers.insert(identifier);
411+
}
412+
397413
if let Some(symbol) = lazer_symbols.get(&identifier) {
398414
let source_timestamp_micros = price_info.timestamp.and_utc().timestamp_micros();
399415
let source_timestamp = MessageField::some(Timestamp {

0 commit comments

Comments
 (0)