Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pawel plesniak/drunc op mon #18

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

PawelPlesniak
Copy link

Adds a python handle to convert messages into a OpMonEntry format.
Notes

  • OpMonId.substructure is null by default
  • OpMonEntry.custom_origin is a dict[str,str] with emptry strings by default

Copy link
Contributor

@mroda88 mroda88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments.
Also, we need 2 additional things:

  • Documentation on how the API differ from the C++
  • We need a test app.

class OpMonPublisher:
def __init__(
self,
topic:str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like this to be the default_topic rather than just topic. The reason being that we envision the possibility of using multiple topics at some point so the algorithm that selects the topic given a metric at the moment is just returning the default, but it might not be the case for long

application = application,
substructure = substructure
)
t = Timestamp()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp should be the first thing happening.

case fd.CPPTYPE_BOOL:
formatted_OpMonValue.boolean_value = value
case fd.CPPTYPE_STRING:
formatted_OpMonValue.string_value = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to handle the case in which the type is a message itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The equivalent C++ is https://github.com/DUNE-DAQ/opmonlib/blob/721d3fcb21fe087cddf14cb877ff6da514ae26d2/src/Utils.cpp#L84-L90 The rest of the code has to be handled accordingly.

@@ -0,0 +1,17 @@
class OpMonFunction :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this was extracted into a separate file?
Otherwise I would prefer to restore as it was. The reason being that the file was supposed to be unique to simplify the construction of the microservice: https://github.com/DUNE-DAQ/microservices/blob/5a8182e9459e7f451eff6aed4da4dd06ccdc2eb5/dockerfiles/microservices-dependencies.dockerfile#L44

def execute(self, e : entry.OpMonEntry ) :
self.function(e)

from kafkaopmon import OpMonFunction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous note on this extraction

@mroda88 mroda88 added enhancement New feature or request miscellaneous deliverables A change that is/will be part of the release but it's not substantial enough to be a daq-deliverable labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request miscellaneous deliverables A change that is/will be part of the release but it's not substantial enough to be a daq-deliverable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants