You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Batch insert observed messages using Duckdb appender (#998)
* Batch insert observed messages using Duckdb appender
For fast batch insertion of messages observed into duckdb, use the
native appender to batch the messages based on size or max wait time.
Whichever happens first.
Fixes#993
* Periodically attempt to flush in-flight messages out to the database
This is to ensure max batch delay is respected independent of message
arrival/discovery flow.
* Fix usage of timer instead of ticker for both rotation and flush
Copy file name to clipboardExpand all lines: cmd/f3/observer.go
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,16 @@ var observerCmd = cli.Command{
105
105
Usage: "The connectivity threshold below which peer discovery via Lotus Net Peers is engaged. Disabled if set to zero or no lotusDaemon endpoints are provided.",
106
106
Value: 100,
107
107
},
108
+
&cli.IntFlag{
109
+
Name: "maxBatchSize",
110
+
Usage: "The maximum number of messages to batch together in a single insertion into database.",
111
+
Value: 1000,
112
+
},
113
+
&cli.DurationFlag{
114
+
Name: "maxBatchDelay",
115
+
Usage: "The maximum time to wait before a batch is flushed to the database.",
116
+
Value: time.Minute,
117
+
},
108
118
},
109
119
110
120
Action: func(cctx*cli.Context) error {
@@ -116,6 +126,8 @@ var observerCmd = cli.Command{
0 commit comments