Skip to content

Commit

Permalink
Change processor interface to include register metrics method, so pro…
Browse files Browse the repository at this point in the history
…cessors get their cusrtom metrics registered into the agent server
  • Loading branch information
gdiazlo committed Mar 19, 2019
1 parent 494ac97 commit 17b699c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gossip/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,25 @@ import (

"github.com/bbva/qed/log"
"github.com/bbva/qed/protocol"
"github.com/prometheus/client_golang/prometheus"
)

type Processor interface {
Process(*protocol.BatchSnapshots)
RegisterMetrics(*prometheus.Registry)
}

type FakeProcessor struct {
}

func (d FakeProcessor) Process(b *protocol.BatchSnapshots) {
}
func (d FakeProcessor) Process(b *protocol.BatchSnapshots) {}
func (d FakeProcessor) RegisterMetrics(r *prometheus.Registry) {}

type DummyProcessor struct {
}

func (d DummyProcessor) RegisterMetrics(r *prometheus.Registry) {}

func (d DummyProcessor) Process(b *protocol.BatchSnapshots) {
for i := 0; i < len(b.Snapshots); i++ {
res, err := http.Get(fmt.Sprintf("http://127.0.0.1:8888/stat/?nodeType=auditor&id=%d", b.Snapshots[0].Snapshot.Version))
Expand Down

0 comments on commit 17b699c

Please sign in to comment.