Skip to content

Commit

Permalink
Add dump for UniqueConnectionsReport & VerifiedUniqueConnectionsReport (
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie authored Dec 13, 2024
1 parent a858b72 commit 52b1aa7
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions file_store/src/cli/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{
mobile_subscriber::{SubscriberLocationIngestReport, VerifiedSubscriberLocationIngestReport},
speedtest::{CellSpeedtest, CellSpeedtestIngestReport},
traits::{MsgDecode, TimestampDecode},
unique_connections::UniqueConnectionReq,
usage_counts::{HexUsageCountsIngestReport, RadioUsageCountsIngestReport},
wifi_heartbeat::WifiHeartbeatIngestReport,
FileType, Result, Settings,
Expand All @@ -30,8 +31,9 @@ use helium_proto::{
CoverageObjectV1, Heartbeat, HexUsageStatsIngestReportV1,
InvalidDataTransferIngestReportV1, MobileRewardShare, OracleBoostingReportV1,
RadioRewardShare, RadioUsageStatsIngestReportV1, SpeedtestAvg, SpeedtestIngestReportV1,
SpeedtestReqV1, VerifiedInvalidatedRadioThresholdIngestReportV1,
VerifiedRadioThresholdIngestReportV1,
SpeedtestReqV1, UniqueConnectionsIngestReportV1,
VerifiedInvalidatedRadioThresholdIngestReportV1, VerifiedRadioThresholdIngestReportV1,
VerifiedUniqueConnectionsIngestReportV1,
},
router::PacketRouterPacketReportV1,
},
Expand Down Expand Up @@ -392,6 +394,31 @@ impl Cmd {
"coverage": coverage.coverage,
}))?;
}
FileType::UniqueConnectionsReport => {
let report = UniqueConnectionsIngestReportV1::decode(msg)?;
let req = UniqueConnectionReq::try_from(report.report.unwrap())?;
print_json(&json!({
"pubkey": req.pubkey,
"start_timestamp": req.start_timestamp,
"end_timestamp": req.end_timestamp,
"unique_connections": req.unique_connections,
"timestamp": req.timestamp,
"carrier_key": req.carrier_key,
}))?;
}
FileType::VerifiedUniqueConnectionsReport => {
let verified_report = VerifiedUniqueConnectionsIngestReportV1::decode(msg)?;
let report = verified_report.report.unwrap();
let req = UniqueConnectionReq::try_from(report.report.unwrap())?;
print_json(&json!({
"pubkey": req.pubkey,
"start_timestamp": req.start_timestamp,
"end_timestamp": req.end_timestamp,
"unique_connections": req.unique_connections,
"timestamp": req.timestamp,
"carrier_key": req.carrier_key,
}))?;
}
missing_filetype => println!("No dump for {missing_filetype}"),
}
}
Expand Down

0 comments on commit 52b1aa7

Please sign in to comment.