mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-26 07:30:00 -07:00
27 lines
575 B
Go
27 lines
575 B
Go
package memory
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/sot-tech/mochi/storage"
|
|
"github.com/sot-tech/mochi/storage/test"
|
|
)
|
|
|
|
func createNew() storage.PeerStorage {
|
|
ps, err := NewPeerStorage(Config{
|
|
ShardCount: 1024,
|
|
GarbageCollectionInterval: 10 * time.Minute,
|
|
PrometheusReportingInterval: 10 * time.Minute,
|
|
PeerLifetime: 30 * time.Minute,
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return ps
|
|
}
|
|
|
|
func TestStorage(t *testing.T) { test.RunTests(t, createNew()) }
|
|
|
|
func BenchmarkStorage(b *testing.B) { test.RunBenchmarks(b, createNew) }
|