BgpkitBroker::latest does not apply filters
Closed this issue · 2 comments
jmeggitt commented
Calling .latest()
currently retrieves all of the latest broker items without applying the configured filters. Ideally the filters would be applied in such a way that the results are equivalent to calling .query()
then picking out only the latest entries.
Example
let broker_items = BgpkitBroker::new()
.collector_id("rrc15")
.data_type("rib")
.latest();
for item in broker_items {
println!("{:?}", item);
}
Expected Output
Only items matching the configured filters are returned.
BrokerItem { ts_start: 2023-09-15T16:00:00, ts_end: 2023-09-15T16:00:00, collector_id: "rrc15", data_type: "rib", url: "https://data.ris.ripe.net/rrc15/2023.09/bview.20230915.1600.gz", rough_size: 189792256, exact_size: 0 }
Actual Output
All of the latest items are returned.
BrokerItem { ts_start: 2023-09-15T20:00:00, ts_end: 2023-09-15T20:00:00, collector_id: "route-views.amsix", data_type: "rib", url: "http://archive.routeviews.org/route-views.amsix/bgpdata/2023.09/RIBS/rib.20230915.2000.bz2", rough_size: 128974848, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T21:30:00, ts_end: 2023-09-15T21:45:00, collector_id: "route-views.amsix", data_type: "update", url: "http://archive.routeviews.org/route-views.amsix/bgpdata/2023.09/UPDATES/updates.20230915.2130.bz2", rough_size: 8598323, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T20:00:00, ts_end: 2023-09-15T20:00:00, collector_id: "route-views.bdix", data_type: "rib", url: "http://archive.routeviews.org/route-views.bdix/bgpdata/2023.09/RIBS/rib.20230915.2000.bz2", rough_size: 148, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T21:30:00, ts_end: 2023-09-15T21:45:00, collector_id: "route-views.bdix", data_type: "update", url: "http://archive.routeviews.org/route-views.bdix/bgpdata/2023.09/UPDATES/updates.20230915.2130.bz2", rough_size: 14, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T20:00:00, ts_end: 2023-09-15T20:00:00, collector_id: "route-views.bknix", data_type: "rib", url: "http://archive.routeviews.org/route-views.bknix/bgpdata/2023.09/RIBS/rib.20230915.2000.bz2", rough_size: 11534336, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T21:30:00, ts_end: 2023-09-15T21:45:00, collector_id: "route-views.bknix", data_type: "update", url: "http://archive.routeviews.org/route-views.bknix/bgpdata/2023.09/UPDATES/updates.20230915.2130.bz2", rough_size: 102400, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T20:00:00, ts_end: 2023-09-15T20:00:00, collector_id: "route-views.chicago", data_type: "rib", url: "http://archive.routeviews.org/route-views.chicago/bgpdata/2023.09/RIBS/rib.20230915.2000.bz2", rough_size: 65011712, exact_size: 0 }
BrokerItem { ts_start: 2023-09-15T21:30:00, ts_end: 2023-09-15T21:45:00, collector_id: "route-views.chicago", data_type: "update", url: "http://archive.routeviews.org/route-views.chicago/bgpdata/2023.09/UPDATES/updates.20230915.2130.bz2", rough_size: 1468006, exact_size: 0 }
etc...
digizeph commented
Good point. Will fix!
digizeph commented
Fixed in #29. Released v0.7.0-beta.1
for this. https://crates.io/crates/bgpkit-broker/0.7.0-beta.1