···4545export def wait-for-backfill [url: string] {
4646 print "waiting for backfill to complete..."
4747 for i in 1..120 {
4848- let stats = (http get $"($url)/stats?accurate=true").keyspace_stats
4949- let pending = ($stats | where name == "pending" | first).count
5050- let records = ($stats | where name == "records" | first).count
5151- let repos = ($stats | where name == "repos" | first).count
5252- let resync = ($stats | where name == "resync" | first).count
4848+ let stats = (http get $"($url)/stats?accurate=true").counts
4949+ let pending = ($stats.pending | into int)
5050+ let records = ($stats.records | into int)
5151+ let repos = ($stats.repos | into int)
5252+ let resync = ($stats.resync | into int)
53535454 print $"[($i)/120] pending: ($pending), records: ($records), repos: ($repos), resync: ($resync)"
5555
+2-2
tests/stream_test.nu
···67676868 sleep 2sec
69697070- let stats = (http get $"($url)/stats?accurate=true").keyspace_stats
7171- let events_count = ($stats | where name == "events" | first).count
7070+ let stats = (http get $"($url)/stats?accurate=true").counts
7171+ let events_count = ($stats.events | into int)
7272 print $"total events in db: ($events_count)"
73737474 if $events_count > 0 {