MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / make_event

Function make_event

nodedb/src/event/cdc/buffer.rs:262–283  ·  view source on GitHub ↗
(seq: u64, lsn: u64)

Source from the content-addressed store, hash-verified

260 use super::*;
261
262 fn make_event(seq: u64, lsn: u64) -> CdcEvent {
263 let now_ms = std::time::SystemTime::now()
264 .duration_since(std::time::UNIX_EPOCH)
265 .unwrap()
266 .as_millis() as u64;
267 CdcEvent {
268 sequence: seq,
269 partition: 0,
270 collection: "test".into(),
271 op: "INSERT".into(),
272 row_id: format!("row-{seq}"),
273 event_time: now_ms + seq * 1000,
274 lsn,
275 tenant_id: 1,
276 new_value: None,
277 old_value: None,
278 schema_version: 0,
279 field_diffs: None,
280 system_time_ms: None,
281 valid_time_ms: None,
282 }
283 }
284
285 #[test]
286 fn push_and_read() {

Callers 5

push_and_readFunction · 0.70
evicts_at_capacityFunction · 0.70
read_from_lsn_with_limitFunction · 0.70
make_event_on_partitionFunction · 0.70

Calls 3

nowFunction · 0.85
duration_sinceMethod · 0.80
as_millisMethod · 0.45

Tested by 4

push_and_readFunction · 0.56
evicts_at_capacityFunction · 0.56
read_from_lsn_with_limitFunction · 0.56