Skip to content

Commit 28d201f

Browse files
authored
Merge pull request #30 from UiPath/fix/samples
chore: measure http req duration
2 parents d27cc4b + 1413f39 commit 28d201f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.26"
3+
version = "0.0.27"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_session.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import logging
3+
import time
34

45
import mcp.types as types
56
from mcp import StdioServerParameters
@@ -183,12 +184,15 @@ async def send_outgoing_message(self, message: types.JSONRPCMessage) -> None:
183184
message, session_id=self.session_id, server_name=self.server_config.name
184185
) as span:
185186
try:
187+
start_time = time.time()
186188
response = self._uipath.api_client.request(
187189
"POST",
188190
f"mcp_/mcp/{self.server_config.name}/out/message?sessionId={self.session_id}",
189191
json=message.model_dump(),
190192
)
191193

194+
duration_ms = (time.time() - start_time) * 1000
195+
span.set_attribute("http_duration_ms", duration_ms)
192196
span.set_attribute("http_status_code", response.status_code)
193197

194198
if response.status_code == 202:

0 commit comments

Comments
 (0)