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

feat: add metrics publisher for NT #1791

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

samfreund
Copy link
Contributor

this might work, but it still needs testing.

we don't know if it actually publishes, also don't know how much resources this'll consume

@samfreund samfreund requested a review from a team as a code owner February 19, 2025 18:22
@samfreund samfreund marked this pull request as draft February 19, 2025 18:22
@samfreund
Copy link
Contributor Author

Also add a way to toggle this in settings.

@mcm001
Copy link
Contributor

mcm001 commented Feb 19, 2025

Also add a way to toggle this in settings.

Nah. Keep it on. IMO this kind of participant metrics could be good to have as a NT protocol extnesion

@@ -129,6 +129,24 @@ public String getIpAddress() {
return addr;
}

public HashMap<String, String> getMetrics() {
HashMap<String, String> metrics = new HashMap<String, String>();
Copy link
Contributor

Choose a reason for hiding this comment

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

What drove you to use a HashMap here? It looks like this code is duplicated from publishMetrics. Can we switch both to a Jackson serializable Java POD class? And we might consider a NT struct here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just used a hashmap cause we use it in the publishMetrics as well. When you say NT struct, do you mean like a subtable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also think a hashmap might be the best option as it lets us easily iterate through everything

Copy link
Member

Choose a reason for hiding this comment

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

I think a struct is the best option for publishing to NT then a shared type between photonlib and the backend for accessing the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants