From e463a4d025cbe31ff15ec5115fe995eb774b6cd9 Mon Sep 17 00:00:00 2001 From: wphan Date: Thu, 7 Dec 2023 11:30:47 -0800 Subject: [PATCH 1/2] use grpc slotsource --- src/publishers/dlobPublisher.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 0e90f56..7aa15d6 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -220,6 +220,10 @@ const main = async () => { }); dlobProvider = getDLOBProviderFromGrpcOrderSubscriber(grpcOrderSubscriber); + + slotSource = { + getSlot: () => grpcOrderSubscriber.getSlot(), + }; } else { const userMap = new UserMap({ driftClient, From 5dd7270a89e37b2640f70ce96ab5275afecd080e Mon Sep 17 00:00:00 2001 From: wphan Date: Thu, 7 Dec 2023 14:20:42 -0800 Subject: [PATCH 2/2] add current system ts metric --- src/core/metrics.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/metrics.ts b/src/core/metrics.ts index 2a4f0f7..e1ea1da 100644 --- a/src/core/metrics.ts +++ b/src/core/metrics.ts @@ -39,6 +39,7 @@ enum METRIC_TYPES { endpoint_response_status = 'endpoint_response_status', gpa_fetch_duration = 'gpa_fetch_duration', last_ws_message_received_ts = 'last_ws_message_received_ts', + current_system_ts = 'current_system_ts', health_status = 'health_status', } @@ -124,6 +125,16 @@ lastWsReceivedTsGauge.addCallback((obs: ObservableResult) => { obs.observe(lastWsMsgReceivedTs, {}); }); +const currentSystemTsGauge = meter.createObservableGauge( + METRIC_TYPES.current_system_ts, + { + description: 'Timestamp of system at time of metric collection', + } +); +currentSystemTsGauge.addCallback((obs: ObservableResult) => { + obs.observe(Date.now(), {}); +}); + const endpointResponseTimeHistogram = meter.createHistogram( METRIC_TYPES.endpoint_response_times_histogram, {