Skip to content

Commit

Permalink
8: added archive pool metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Feb 8, 2024
1 parent 2ed8616 commit d56b069
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/soroban-rpc/internal/ingest/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/stellar/go/historyarchive"
"github.com/stellar/go/ingest/ledgerbackend"
"github.com/stellar/go/network"
supportlog "github.com/stellar/go/support/log"
Expand Down Expand Up @@ -65,6 +66,16 @@ func TestRetryRunningIngestion(t *testing.T) {
func TestIngestion(t *testing.T) {
mockDB := &MockDB{}
mockLedgerBackend := &ledgerbackend.MockDatabaseBackend{}

mockArchive := historyarchive.MockArchive{}
mockArchiveStats := historyarchive.MockArchiveStats{}
mockArchive.On("GetStats").Return([]historyarchive.ArchiveStats{&mockArchiveStats}).Once()
mockArchiveStats.On("GetBackendName").Return("").Times(4)
mockArchiveStats.On("GetDownloads").Return(uint32(0)).Once()
mockArchiveStats.On("GetCacheHits").Return(uint32(0)).Once()
mockArchiveStats.On("GetRequests").Return(uint32(0)).Once()
mockArchiveStats.On("GetUploads").Return(uint32(0)).Once()

daemon := interfaces.MakeNoOpDeamon()
config := Config{
Logger: supportlog.New(),
Expand All @@ -74,6 +85,7 @@ func TestIngestion(t *testing.T) {
LedgerBackend: mockLedgerBackend,
Daemon: daemon,
NetworkPassPhrase: network.TestNetworkPassphrase,
Archive: &mockArchive,
}
sequence := uint32(3)
service := newService(config)
Expand Down

0 comments on commit d56b069

Please sign in to comment.