File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { ok } from 'node:assert'
2
2
import { cpus as osCpus } from 'node:os'
3
3
import {
4
+ Gauge ,
4
5
Counter ,
5
6
Summary ,
6
7
} from 'prom-client'
@@ -85,6 +86,11 @@ const runGtfsMatching = async (cfg, opt = {}) => {
85
86
...opt ,
86
87
}
87
88
89
+ const natsMsgSeq = new Gauge ( {
90
+ name : 'nats_msg_seq' ,
91
+ help : 'sequence number of the latest NATS message being processed' ,
92
+ registers : [ register ] ,
93
+ } )
88
94
const successesTotal = new Counter ( {
89
95
name : 'matching_successes_total' ,
90
96
help : 'number of successfully matched movements/trips' ,
@@ -176,6 +182,8 @@ const runGtfsMatching = async (cfg, opt = {}) => {
176
182
seq,
177
183
dataSlice : data . slice ( 0 , 100 ) . toString ( 'utf8' ) ,
178
184
} , 'processing AUS IstFahrt msg' )
185
+ natsMsgSeq . set ( seq ) // todo: is `seq` an integer?
186
+
179
187
try {
180
188
const ausIstFahrt = msg . json ( data )
181
189
// todo: validate against schema, error-log and abort if invalid
You can’t perform that action at this time.
0 commit comments