This repository was archived by the owner on Nov 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-23
lines changed
Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 1- import { writeAll } from " https://deno.land/[email protected] /io/write_all.ts" ; 2- import { Queue } from " ./messenger.ts" ;
1+ import { writeAll } from ' https://deno.land/[email protected] /io/write_all.ts' ; 2+ import { Queue } from ' ./messenger.ts' ;
33
44export function collectMetrics ( ) {
55 return {
@@ -15,17 +15,3 @@ export async function sendMetrics() {
1515
1616 await writeAll ( Deno . stderr , encoder . encode ( JSON . stringify ( metrics ) ) ) ;
1717}
18-
19- let intervalId : number ;
20-
21- export function startMetricsReport ( frequencyInMs = 5000 ) {
22- if ( intervalId ) {
23- throw new Error ( 'There is already an active metrics report' ) ;
24- }
25-
26- intervalId = setInterval ( sendMetrics , frequencyInMs ) ;
27- }
28-
29- export function abortMetricsReport ( ) {
30- clearInterval ( intervalId ) ;
31- }
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ import apiHandler from './handlers/api-handler.ts';
2222import handleApp from './handlers/app/handler.ts' ;
2323import handleScheduler from './handlers/scheduler-handler.ts' ;
2424import registerErrorListeners from './error-handlers.ts' ;
25- import { startMetricsReport } from './lib/metricsCollector.ts' ;
26- import { parseArgs } from './lib/parseArgs.ts' ;
25+ import { sendMetrics } from './lib/metricsCollector.ts' ;
2726
2827type Handlers = {
2928 app : typeof handleApp ;
@@ -105,7 +104,8 @@ async function main() {
105104 try {
106105 // Process PING command first as it is not JSON RPC
107106 if ( message === COMMAND_PING ) {
108- Messenger . pongResponse ( ) ;
107+ void Messenger . pongResponse ( ) ;
108+ void sendMetrics ( ) ;
109109 continue ;
110110 }
111111
@@ -129,10 +129,6 @@ async function main() {
129129 }
130130}
131131
132- const mainArgs = parseArgs ( Deno . args ) ;
133-
134132registerErrorListeners ( ) ;
135133
136134main ( ) ;
137-
138- startMetricsReport ( mainArgs . metricsReportFrequencyInMs ) ;
You can’t perform that action at this time.
0 commit comments