lidavidm commented on issue #12974:
URL: https://github.com/apache/arrow/issues/12974#issuecomment-1108490825
Do the timing in the generator itself, or use middleware, something like
```python
class TimingServerMiddleware(flight.ServerMiddleware):
def __init__(self, start):
self.start = start
def call_completed(self, exception):
print("Duration:", time.monotonic() - self.start)
class TimingServerMiddlewareFactory(flight.ServerMiddlewareFactory):
def start_call(self, info, headers):
return TimingServerMiddleware(time.monotonic())
server = Server(..., middlware={"timing": TimingServerMiddlewareFactory()})
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]