Skip to content

Commit

Permalink
stellar#4433: fixes to incorporate after latest merge of metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 12, 2022
1 parent 427611d commit ad2b90a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exp/lighthorizon/actions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var (
//go:embed static
staticFiles embed.FS
staticFiles embed.FS
requestCount = promauto.NewCounter(prometheus.CounterOpts{
Name: "horizon_lite_request_count",
Help: "How many requests have occurred?",
Expand Down
5 changes: 5 additions & 0 deletions exp/lighthorizon/index/mock_store.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package index

import (
"github.com/prometheus/client_golang/prometheus"
types "github.com/stellar/go/exp/lighthorizon/index/types"
"github.com/stretchr/testify/mock"
)
Expand Down Expand Up @@ -71,3 +72,7 @@ func (m *MockStore) MergeTransactions(prefix string, other *types.TrieIndex) err
args := m.Called(prefix, other)
return args.Error(0)
}

func (m *MockStore) RegisterMetrics(registry *prometheus.Registry) {
m.Called(registry)
}
2 changes: 1 addition & 1 deletion exp/lighthorizon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {
router.MethodFunc(http.MethodGet, "/operations", actions.Operations(lightHorizon))
router.MethodFunc(http.MethodGet, "/transactions", actions.Transactions(lightHorizon))
router.MethodFunc(http.MethodGet, "/", actions.ApiDocs())
router.MethodFunc(http.MethodGet, "/metrics", promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))
router.Method(http.MethodGet, "/metrics", promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))

log.Fatal(http.ListenAndServe(":8080", router))
}

0 comments on commit ad2b90a

Please sign in to comment.