Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dump for UniqueConnectionsReport & VerifiedUniqueConnectionsReport #913

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, do you need to do a selective print ? you could just do print_json(&req)?;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we just want to not have the signature

"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