-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add telemetry packets to JSON dictionary spec #3221
base: devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one question. Otherwise the packet stuff looks good. The other items look consistent with recent updates.
"name" : "Packets", | ||
"members" : [ | ||
{ | ||
"name" : "P1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect the packet name to be qualified, shouldn't I? i.e. M.T.P1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that it would likely make things easier on the GDS to have a qualified name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make the name qualified if you want, but to me that seems unusual. The packet name is part of the packet set definition, similarly to the way a struct member name is part of a struct definition. In the past the convention we've used is that definitions use simple names and uses use qualified names. The issue with uses is that without the explicit qualification you have to do some name lookup. With definitions there is no such issue -- the name is qualified by the definition in which it appears.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name of the packet set in which the packet appears should be explicitly qualified by the (fully qualified) name of the topology in which it appears in the FPP source. Is that what we are currently doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past the convention we've used is that definitions use simple names and uses use qualified names.
Unless the definition is stripped out of the qualifying context. So for example (I think) we use qualified names for the names of struct types but simple names for the members. We have to use qualified names for the types because the enclosing module context is stripped away when passing from the FPP source to the dictionary.
Here I think we need the module (and topology) context for the packet set. We could also add that to every packet in the set, but to me it seems overly verbose and maybe inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I think there's also an argument that we don't need the qualifier for the packet set (so the example is correct as is) because everything in the dictionary pertains to that topology. So the topology qualifier is redundant (indeed, everything in the dictionary could be qualified that way).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we generate C++ code, the packet sets will become classes, and their names will be appropriately qualified, because in C++ we don't assume that the code exists in an outer topology context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my current implementation, telemetry packet set names are not fully qualified. This is also the case for the
set members/telemetry packet names. @LeStarch @thomas-bc is there a specific use case you have in mind for the GDS that would benefit from making these names fully qualified? After talking to Rob, we were thinking of adding a topology name field to the dictionary metadata (for ex: topologyName: M.T
) which would make that information available in the dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were thinking of adding a topology name field to the dictionary metadata
The latest thinking is that the deployment name
field should hold the fully-qualified topology name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we generate C++ code, the packet sets will become classes
Note: In the current C++ implementation, the packet sets are stored as instances of a generic class called Svc::TlmPacketizerPacketList
. The names are used for generating local variables that are hidden inside the implementation. There is no name qualification, and the names are not globally visible at all. This is true for both packets and packet sets.
"name" : "Packets", | ||
"members" : [ | ||
{ | ||
"name" : "P1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that it would likely make things easier on the GDS to have a qualified name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! My only comment is that in the examples the instance names are written in CapitalCase
. For stylistic consistency we may want to use camelCase
. For example, instead of instance C1: C
write instance c1: C
. When I saw C1
used as an instance qualifier, my first thought was that C1
named a component rather than an instance.
@@ -920,7 +920,7 @@ module M { | |||
|
|||
| Field | Description | Options | Required | | |||
| ----- | ----------- | ------- | -------- | | |||
| `deploymentName` | **String** representing the deployment name | **String** | true | | |||
| `deploymentName` | Fully qualified name of the topology | **String** | true | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but maybe we should keep the form "String representing ..." for consistency with the other fields? Or revise the other fields to match.
Change Description
Updated the JSON dictionary specification to include telemetry packets and telemetry packet sets. Also cleaned up examples so they are more consistent/accurate.