storage/sqlite/sqlite-storage.go | 8 ++++++-- diff --git a/storage/sqlite/sqlite-storage.go b/storage/sqlite/sqlite-storage.go index 6fc5bc42c34f161203aa22cacd34fbd256f897e8..66d73a28dec23b13450df0059a2129caeb93a8e0 100644 --- a/storage/sqlite/sqlite-storage.go +++ b/storage/sqlite/sqlite-storage.go @@ -342,6 +342,8 @@ query withConn done chan<- error } +var expvars = expvar.NewMap("sqliteStorage") + // Intentionally avoids holding a reference to *provider to allow it to use a finalizer, and to have // stronger typing on the writes channel. func providerWriter(writes <-chan writeRequest, pool ConnPool) { @@ -376,13 +378,15 @@ } }() // Not sure what to do if this failed. if cantFail != nil { - panic(cantFail) + expvars.Add("batchTransactionErrors", 1) } // Signal done after we know the transaction succeeded. for _, done := range buf { done() } - //log.Printf("batched %v write queries", len(buf)) + expvars.Add("batchTransactions", 1) + expvars.Add("batchedQueries", int64(len(buf))) + log.Printf("batched %v write queries", len(buf)) } }