Fix relay metrics

This commit is contained in:
Alex Gleason 2024-06-22 10:28:42 -05:00
parent e50ba819b9
commit c44347e9d1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -10,7 +10,7 @@ import {
import { AppController } from '@/app.ts'; import { AppController } from '@/app.ts';
import { relayInfoController } from '@/controllers/nostr/relay-info.ts'; import { relayInfoController } from '@/controllers/nostr/relay-info.ts';
import { relayEventCounter, relayMessageCounter } from '@/metrics.ts'; import { relayCountCounter, relayEventCounter, relayMessageCounter, relayReqCounter } from '@/metrics.ts';
import * as pipeline from '@/pipeline.ts'; import * as pipeline from '@/pipeline.ts';
import { RelayError } from '@/RelayError.ts'; import { RelayError } from '@/RelayError.ts';
import { Storages } from '@/storages.ts'; import { Storages } from '@/storages.ts';
@ -42,7 +42,7 @@ function connectStream(socket: WebSocket) {
function handleMsg(msg: NostrClientMsg) { function handleMsg(msg: NostrClientMsg) {
switch (msg[0]) { switch (msg[0]) {
case 'REQ': case 'REQ':
relayEventCounter.inc(); relayReqCounter.inc();
handleReq(msg); handleReq(msg);
return; return;
case 'EVENT': case 'EVENT':
@ -53,7 +53,7 @@ function connectStream(socket: WebSocket) {
handleClose(msg); handleClose(msg);
return; return;
case 'COUNT': case 'COUNT':
relayEventCounter.inc(); relayCountCounter.inc();
handleCount(msg); handleCount(msg);
return; return;
} }