-
Notifications
You must be signed in to change notification settings - Fork 42
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
philosophy of known metrics #93
Comments
No, within the constructor of the application / node. Check out the examples or my answer under #92, please.
This is not yet possible, but will be possible after #44 is done. |
I hope this is answered with #92 (comment) already. If not, feel free to contact me again / re-open the issue(s). |
@SeppPenner: I agree with @jeff-pf: |
I misunderstood this before, but you're absolutely right. This won't work. I need to change the logic for the applications. |
My temp solution was to add a public function to metric storage to be able to add the birth metrics. public void AddVersionB_BirthMetric(T metric, Metric versionBMetric)
{
// Check the name of the metric.
if (string.IsNullOrWhiteSpace(versionBMetric.Name))
{
// Check the alias of the metric.
if (versionBMetric.Alias is null)
{
throw new InvalidMetricException($"A metric without a name and an alias is not allowed.");
}
// Check the value of the metric.
if (versionBMetric.Value is null)
{
throw new InvalidMetricException($"A metric without a current value is not allowed.");
}
}
else
{
// Check the value of the metric.
if (versionBMetric.Value is null)
{
throw new InvalidMetricException($"A metric without a current value is not allowed.");
}
// Check the alias of the metric.
if (versionBMetric.Alias is null)
{
// Hint: Data type doesn't need to be checked, is not nullable.
this.knownMetricsByName[versionBMetric.Name] = metric;
}
else
{
// Hint: Data type doesn't need to be checked, is not nullable.
this.knownMetricsByAlias[versionBMetric.Alias.Value] = metric;
}
}
} I am creating a birth metric list in the birth event handler and then the application adds them. |
Going down the rabbit hole a little further - I see a few other issues also.
I am happy to help think through this - let me know if there is anything I can help with. |
Rules for the Node Control/Rebirth metric from the 3.0 spec (in ref to issue #44 - but also relevant here - just to clarify)
• [tck-id-operational-behavior-data-commands-rebirth-name] An NBIRTH message MUST
Upon receipt of a Rebirth Request, the Edge Node must do the following. |
I made this change so I can publish a node rebirth command from the application
|
Let me think about this whole mess a few more days. I guess, how it's implemented right now is way to complicated... |
I am failing to see how to add birth metrics to the application known metrics - it seems like I should be able to do it in the NBirth and DBirth event handlers. Also how do I update the value of the know metrics using the NData and DData? Or is this not the right philosophy for the known metrics - do I need to in parallel also keep track of metric values?
The text was updated successfully, but these errors were encountered: