diff --git a/pkg/api/controllers/context_test.go b/pkg/api/controllers/context_test.go index 737b05885..838dbb1ae 100644 --- a/pkg/api/controllers/context_test.go +++ b/pkg/api/controllers/context_test.go @@ -24,7 +24,7 @@ func TestContext(t *testing.T) { _, err := uuid.Parse(rsp.Header().Get(string(pkg.KeyContextID))) require.NoError(t, err) }) - t.Run("GET/log", func(t *testing.T) { + t.Run("GET/logs", func(t *testing.T) { rsp := internal.GetLedgerLogs(api, url.Values{}) _, err := uuid.Parse(rsp.Header().Get(string(pkg.KeyContextID))) require.NoError(t, err) diff --git a/pkg/api/controllers/swagger.yaml b/pkg/api/controllers/swagger.yaml index 11c880697..6674f7f59 100644 --- a/pkg/api/controllers/swagger.yaml +++ b/pkg/api/controllers/swagger.yaml @@ -975,7 +975,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' - /{ledger}/log: + /{ledger}/logs: get: tags: - Logs diff --git a/pkg/api/internal/testing.go b/pkg/api/internal/testing.go index 96c538c0b..528658f09 100644 --- a/pkg/api/internal/testing.go +++ b/pkg/api/internal/testing.go @@ -199,7 +199,7 @@ func GetLedgerStats(handler http.Handler) *httptest.ResponseRecorder { } func GetLedgerLogs(handler http.Handler, query url.Values) *httptest.ResponseRecorder { - req, rec := NewRequest(http.MethodGet, fmt.Sprintf("/%s/log", testingLedger), nil) + req, rec := NewRequest(http.MethodGet, fmt.Sprintf("/%s/logs", testingLedger), nil) req.URL.RawQuery = query.Encode() handler.ServeHTTP(rec, req) return rec diff --git a/pkg/api/routes/routes.go b/pkg/api/routes/routes.go index 17da3ee91..ab4fb4662 100644 --- a/pkg/api/routes/routes.go +++ b/pkg/api/routes/routes.go @@ -160,7 +160,7 @@ func (r *Routes) Engine() *gin.Engine { // LedgerController dedicatedLedgerRouter.GET("/_info", r.wrapWithScopes(r.ledgerController.GetInfo, ScopesInfoRead)) dedicatedLedgerRouter.GET("/stats", r.wrapWithScopes(r.ledgerController.GetStats, ScopesStatsRead)) - dedicatedLedgerRouter.GET("/log", r.wrapWithScopes(r.ledgerController.GetLogs, ScopesLogsRead)) + dedicatedLedgerRouter.GET("/logs", r.wrapWithScopes(r.ledgerController.GetLogs, ScopesLogsRead)) // AccountController dedicatedLedgerRouter.GET("/accounts", r.wrapWithScopes(r.accountController.GetAccounts, ScopeAccountsRead, ScopeAccountsWrite)) diff --git a/pkg/ledger/ledger_test.go b/pkg/ledger/ledger_test.go index fbfb93428..b9f71c28b 100644 --- a/pkg/ledger/ledger_test.go +++ b/pkg/ledger/ledger_test.go @@ -72,6 +72,7 @@ func runOnLedger(f func(l *ledger.Ledger), ledgerOptions ...ledger.LedgerOption) return err } cache, err := ristretto.NewCache(&ristretto.Config{ + NumCounters: 1e7, // number of keys to track frequency of (10M). MaxCost: 100, // maximum cost of cache. BufferItems: 64, // number of keys per Get buffer.