@@ -26,6 +26,8 @@ type Metrics struct {
2626 BytesSent * metric.Counter
2727 InfosReceived * metric.Counter
2828 InfosSent * metric.Counter
29+ MessagesSent * metric.Counter
30+ MessagesReceived * metric.Counter
2931 CallbacksProcessed * metric.Counter
3032 CallbacksPending * metric.Gauge
3133 CallbacksProcessingDuration metric.IHistogram
@@ -39,6 +41,8 @@ func makeMetrics() Metrics {
3941 BytesSent : metric .NewCounter (MetaBytesSent ),
4042 InfosReceived : metric .NewCounter (MetaInfosReceived ),
4143 InfosSent : metric .NewCounter (MetaInfosSent ),
44+ MessagesReceived : metric .NewCounter (MetaMessagesReceived ),
45+ MessagesSent : metric .NewCounter (MetaMessagesSent ),
4246 CallbacksProcessed : metric .NewCounter (MetaCallbacksProcessed ),
4347 CallbacksPending : metric .NewGauge (MetaCallbacksPending ),
4448 CallbacksProcessingDuration : metric .NewHistogram (metric.HistogramOptions {
@@ -63,11 +67,13 @@ func (m Metrics) String() string {
6367// Snapshot returns a snapshot of the metrics.
6468func (m Metrics ) Snapshot () MetricSnap {
6569 return MetricSnap {
66- ConnsRefused : m .ConnectionsRefused .Count (),
67- BytesReceived : m .BytesReceived .Count (),
68- BytesSent : m .BytesSent .Count (),
69- InfosReceived : m .InfosReceived .Count (),
70- InfosSent : m .InfosSent .Count (),
70+ ConnsRefused : m .ConnectionsRefused .Count (),
71+ BytesReceived : m .BytesReceived .Count (),
72+ BytesSent : m .BytesSent .Count (),
73+ InfosReceived : m .InfosReceived .Count (),
74+ InfosSent : m .InfosSent .Count (),
75+ MessagesReceived : m .MessagesReceived .Count (),
76+ MessagesSent : m .MessagesSent .Count (),
7177 }
7278}
7379
@@ -77,7 +83,8 @@ func (m MetricSnap) String() string {
7783
7884// SafeFormat implements the redact.SafeFormatter interface.
7985func (m MetricSnap ) SafeFormat (w redact.SafePrinter , _ rune ) {
80- w .Printf ("infos %d/%d sent/received, bytes %dB/%dB sent/received" ,
86+ w .Printf ("messages %d/%d sent/received, infos %d/%d sent/received, bytes %dB/%dB sent/received" ,
87+ m .MessagesSent , m .MessagesReceived ,
8188 m .InfosSent , m .InfosReceived ,
8289 m .BytesSent , m .BytesReceived )
8390 if m .ConnsRefused > 0 {
0 commit comments