diff --git a/gossip/auditor/auditor.go b/gossip/auditor/auditor.go index 660451583..a44a863d6 100644 --- a/gossip/auditor/auditor.go +++ b/gossip/auditor/auditor.go @@ -208,6 +208,11 @@ func (t MembershipTask) sendAlert(msg string) { } func (a Auditor) Process(b protocol.BatchSnapshots) { + // Metrics + metrics.Qed_auditor_batches_received_total.Inc() + timer := prometheus.NewTimer(metrics.Qed_auditor_batches_process_seconds) + defer timer.ObserveDuration() + task := &MembershipTask{ qed: a.qed, pubUrl: a.conf.PubUrls[0], diff --git a/gossip/metrics/metrics.go b/gossip/metrics/metrics.go index 3bf94bd2e..0345873f5 100644 --- a/gossip/metrics/metrics.go +++ b/gossip/metrics/metrics.go @@ -67,22 +67,22 @@ var ( }, ) - Qed_auditor_batches_process_seconds = prometheus.NewGauge( - prometheus.GaugeOpts{ + Qed_auditor_batches_process_seconds = prometheus.NewSummary( + prometheus.SummaryOpts{ Name: "qed_auditor_batches_process_seconds", Help: "Duration of Auditor batch processing", }, ) - Qed_monitor_batches_process_seconds = prometheus.NewGauge( - prometheus.GaugeOpts{ + Qed_monitor_batches_process_seconds = prometheus.NewSummary( + prometheus.SummaryOpts{ Name: "qed_monitor_batches_process_seconds", Help: "Duration of Monitor batch processing", }, ) - Qed_publisher_batches_process_seconds = prometheus.NewGauge( - prometheus.GaugeOpts{ + Qed_publisher_batches_process_seconds = prometheus.NewSummary( + prometheus.SummaryOpts{ Name: "qed_publisher_batches_process_seconds", Help: "Duration of Publisher batch processing", }, diff --git a/gossip/monitor/monitor.go b/gossip/monitor/monitor.go index bee2bdcfc..a8dd80780 100644 --- a/gossip/monitor/monitor.go +++ b/gossip/monitor/monitor.go @@ -111,6 +111,11 @@ type QueryTask struct { } func (m Monitor) Process(b protocol.BatchSnapshots) { + // Metrics + metrics.Qed_monitor_batches_received_total.Inc() + timer := prometheus.NewTimer(metrics.Qed_monitor_batches_process_seconds) + defer timer.ObserveDuration() + first := b.Snapshots[0].Snapshot last := b.Snapshots[len(b.Snapshots)-1].Snapshot diff --git a/gossip/publisher/publisher.go b/gossip/publisher/publisher.go index e27f79700..7f58ce78a 100644 --- a/gossip/publisher/publisher.go +++ b/gossip/publisher/publisher.go @@ -105,6 +105,11 @@ type PublishTask struct { } func (p *Publisher) Process(b protocol.BatchSnapshots) { + // Metrics + metrics.Qed_publisher_batches_received_total.Inc() + timer := prometheus.NewTimer(metrics.Qed_publisher_batches_process_seconds) + defer timer.ObserveDuration() + task := &PublishTask{ Batch: b, }