mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
prom: set category for reqCounter
This commit is contained in:
1 parent
57796912e4
commit
d02934f766
2 files changed
+2
-1
No files matched your search
@@ -25,6 +25,7 @@ const coll = db.collection('dataReport');
|
|||||||
|
|
||||||
class DataReportHandler extends Handler {
|
class DataReportHandler extends Handler {
|
||||||
noCheckPermView = true;
|
noCheckPermView = true;
|
||||||
|
category = '#center';
|
||||||
|
|
||||||
@post('installId', Types.String)
|
@post('installId', Types.String)
|
||||||
@post('payload', Types.String)
|
@post('payload', Types.String)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function createRegistry(ctx: Context) {
|
|||||||
const reqCounter = createMetric(Counter, 'hydro_reqcount', 'reqcount', {
|
const reqCounter = createMetric(Counter, 'hydro_reqcount', 'reqcount', {
|
||||||
labelNames: ['domainId'],
|
labelNames: ['domainId'],
|
||||||
});
|
});
|
||||||
ctx.on('handler/create', (h) => reqCounter.inc({ domainId: h.args.domainId }));
|
ctx.on('handler/create', (h) => reqCounter.inc({ domainId: (h as any).category || h.args.domainId }));
|
||||||
|
|
||||||
const judgeCounter = createMetric(Counter, 'hydro_judgecount', 'judgecount');
|
const judgeCounter = createMetric(Counter, 'hydro_judgecount', 'judgecount');
|
||||||
ctx.on('record/judge', () => judgeCounter.inc());
|
ctx.on('record/judge', () => judgeCounter.inc());
|
||||||
|
|||||||
Reference in new issue
Block a user