Skip to content

Commit

Permalink
Adds Beacon State download time log (#1312)
Browse files Browse the repository at this point in the history
* adds log

* imports

* space
  • Loading branch information
claravanstaden authored Oct 17, 2024
1 parent 759118f commit 8b33817
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions relayer/relays/beacon/header/syncer/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import (
"net/http"
"strconv"
"strings"
"time"

"github.com/ethereum/go-ethereum/common"
log "github.com/sirupsen/logrus"
"github.com/snowfork/snowbridge/relayer/relays/util"
)

Expand Down Expand Up @@ -410,7 +412,13 @@ func (b *BeaconClient) GetBeaconState(stateIdOrSlot string) ([]byte, error) {
}

req.Header.Add("Accept", "application/octet-stream")

startTime := time.Now()
res, err := b.httpClient.Do(req)
endTime := time.Now()
duration := endTime.Sub(startTime)
log.WithFields(log.Fields{"startTime": startTime.Format(time.UnixDate), "endTime": endTime.Format(time.UnixDate), "duration": duration.Seconds()}).Warn("beacon state download time")

if err != nil {
return data, err
}
Expand Down

0 comments on commit 8b33817

Please sign in to comment.