Skip to content

Commit

Permalink
Add timing metrics for response to handler in MQ client (#154)
Browse files Browse the repository at this point in the history
# Description
Adds a timestamp when response is emitted for clients to calculate how
long it takes to be handled

# Issues
<!-- If this is related to or closes an issue/other PR, please note them
here -->

# Other Notes
NeonGeckoCom/neon_speech#181

---------

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Nov 10, 2023
1 parent d9798e4 commit bb1bff6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ on:

jobs:
license_tests:
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
with:
packages-exclude: '^(precise-runner|fann2|tqdm|bs4|ovos-phal-plugin|ovos-ocp|bitstruct|audioread).*'
3 changes: 3 additions & 0 deletions neon_audio/tts/neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import os

from os.path import dirname
from time import time

from json_database import JsonStorageXDG
from ovos_bus_client.message import Message
from ovos_plugin_manager.language import OVOSLangDetectionFactory,\
Expand Down Expand Up @@ -339,6 +341,7 @@ def execute(self, sentence: str, ident: str = None, listen: bool = False,
# TODO dedicated klat handler/plugin
if "klat_data" in message.context:
LOG.info("Sending klat.response")
message.context['timing']['response_sent'] = time()
self.bus.emit(
message.forward("klat.response",
{"responses": responses,
Expand Down

0 comments on commit bb1bff6

Please sign in to comment.