File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ const metricNamespace = "percona_clustersync_mongodb"
1111
1212// Counters.
1313var (
14+ //nolint:gochecknoglobals
15+ eventsReadTotal = prometheus .NewCounter (prometheus.CounterOpts {
16+ Name : "events_read_total" ,
17+ Help : "Total number of events read from the source." ,
18+ Namespace : metricNamespace ,
19+ })
20+
1421 //nolint:gochecknoglobals
1522 eventsAppliedTotal = prometheus .NewCounter (prometheus.CounterOpts {
1623 Name : "events_applied_total" ,
@@ -144,6 +151,11 @@ func SetCopyInsertBatchDurationSeconds(dur time.Duration) {
144151 copyInsertBatchDurationSeconds .Set (float64 (dur .Seconds ()))
145152}
146153
154+ // IncEventsRead increments the total number of events read counter.
155+ func IncEventsRead () {
156+ eventsReadTotal .Inc ()
157+ }
158+
147159// AddEventsApplied increments the total number of events applied counter.
148160func AddEventsApplied (v int ) {
149161 eventsAppliedTotal .Add (float64 (v ))
Original file line number Diff line number Diff line change @@ -488,6 +488,7 @@ func (r *Repl) run(opts *options.ChangeStreamOptionsBuilder) {
488488 }
489489
490490 r .eventsRead .Add (1 )
491+ metrics .IncEventsRead ()
491492
492493 if change .Namespace .Database == config .PCSMDatabase {
493494 if r .bulkWrite .Empty () {
You can’t perform that action at this time.
0 commit comments