Skip to content

Commit

Permalink
Code review rework
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Aug 21, 2024
1 parent f6a4db6 commit a42d598
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fly/cmd/prom_gossip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,20 @@ func main() {
}
uniqueObs[hash] = time.Now()
case batch := <-batchObsvC:
gossipByType.WithLabelValues("batch_observation").Inc()
addr := "0x" + string(hex.EncodeToString(batch.Msg.Addr))
name := addr
idx, found := guardianIndexMap[strings.ToLower(addr)]
if found {
name = guardianIndexToNameMap[idx]
}
for _, o := range batch.Msg.Observations {
gossipByType.WithLabelValues("observation").Inc()
spl := strings.Split(o.MessageId, "/")
chain, err := parseChainID(spl[0])
if err != nil {
chain = vaa.ChainIDUnset
}
emitter := strings.ToLower(spl[1])
addr := "0x" + string(hex.EncodeToString(batch.Msg.Addr))
idx := guardianIndexMap[strings.ToLower(addr)]
name := guardianIndexToNameMap[idx]
observationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc()
if knownEmitters[emitter] {
tbObservationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc()
Expand Down

0 comments on commit a42d598

Please sign in to comment.