@@ -208,6 +208,8 @@ export function logSearchQuery(
208208) : void {
209209 // Use a stable mcpServerSessionId per process/transport instance
210210 const mcpServerSessionId = getMcpServerSessionId ( ) ;
211+ const normalizedDurationMs =
212+ options ?. durationMs !== undefined ? Math . round ( options . durationMs ) : undefined ;
211213 const serializedParameters = JSON . stringify ( data ) ;
212214 const requestPayload = {
213215 methodName,
@@ -230,7 +232,7 @@ export function logSearchQuery(
230232 totalResults : options ?. totalResults ,
231233 resultsShared : options ?. resultsShared ,
232234 responseCharCount : options ?. responseCharCount ,
233- durationMs : options ?. durationMs ,
235+ durationMs : normalizedDurationMs ,
234236 success : options ?. success ?? true ,
235237 errorMessage : normalizedError ,
236238 } ) ;
@@ -247,6 +249,8 @@ export function logPromptQuery(
247249) : void {
248250 // Use a stable mcpServerSessionId per process/transport instance
249251 const mcpServerSessionId = getMcpServerSessionId ( ) ;
252+ const normalizedDurationMs =
253+ options ?. durationMs !== undefined ? Math . round ( options . durationMs ) : undefined ;
250254 const serializedParameters = JSON . stringify ( data ) ;
251255 const requestPayload = {
252256 methodName,
@@ -269,7 +273,7 @@ export function logPromptQuery(
269273 totalResults : options ?. totalResults ,
270274 resultsShared : options ?. resultsShared ,
271275 responseCharCount : options ?. responseCharCount ,
272- durationMs : options ?. durationMs ,
276+ durationMs : normalizedDurationMs ,
273277 success : options ?. success ?? true ,
274278 errorMessage : normalizedError ,
275279 } ) ;
0 commit comments