diff --git a/src/client/components/monitor/MonitorDataMetrics.tsx b/src/client/components/monitor/MonitorDataMetrics.tsx
index e7de9b4..66d9a5f 100644
--- a/src/client/components/monitor/MonitorDataMetrics.tsx
+++ b/src/client/components/monitor/MonitorDataMetrics.tsx
@@ -17,8 +17,13 @@ export const MonitorDataMetrics: React.FC<{
workspaceId,
monitorId,
});
+
+ const provider = useMemo(
+ () => getMonitorProvider(monitorType),
+ [monitorType]
+ );
+
const providerOverview = useMemo(() => {
- const provider = getMonitorProvider(monitorType);
if (!provider || !provider.overview) {
return null;
}
@@ -30,7 +35,11 @@ export const MonitorDataMetrics: React.FC<{
))}
>
);
- }, [monitorId, monitorType]);
+ }, [monitorId, provider]);
+
+ const formatterFn = provider?.valueFormatter
+ ? provider?.valueFormatter
+ : (value: number) => `${value}ms`;
if (isLoading) {
return ;
@@ -46,14 +55,14 @@ export const MonitorDataMetrics: React.FC<{
)}