You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use MeterDocumentation with enums to document our metrics, and generally quite like the pattern, as it provides some technical documentation for all our metrics. We extend MeterDocumentation however to add more information. While it would be nice to have that shown by the generator, this is not the problem.
The main issue is that the generator doesn't pick up enums implementing the extending interface, it only picks up enums which directly implement MeterDocumentation.
Take the following ExtendedMeterDocumentation interface:
/** * Extends the base {@link MeterDocumentation} API to allow for more static description, e.g. * help/description associated with a given metric. */publicinterfaceExtendedMeterDocumentationextendsMeterDocumentation {
finalDuration[] EMPTY_SLOS = newDuration[0];
/** Returns the description (also known as {@code help} in some systems) for the given meter. */StringgetDescription();
/** * Returns the buckets to be used if the meter type is a {@link Meter.Type#TIMER} or {@link * Meter.Type#DISTRIBUTION_SUMMARY}. */defaultDuration[] getServiceLevelObjectives() {
returnEMPTY_SLOS;
}
}
And the following enum:
publicenumMyMetricsimplementsExtendedMeterDocumentation {
// ... some metrics
}
Naively, I would expect the generator to pick up MyMetrics, but it does not.
As a workaround, I can do the following:
publicenumMyMetricsimplementsMeterDocumentation, ExtendedMeterDocumentation {
// ... some metrics
}
Then the generator will pick it up. It would be great though if it wasn't necessary to again declare the implementation of MeterDocumentation.
I'm happy to pick this up if you think this would be valuable. I understand there's not much urgency if there is a workaround :)
The text was updated successfully, but these errors were encountered:
Description
We use
MeterDocumentation
with enums to document our metrics, and generally quite like the pattern, as it provides some technical documentation for all our metrics. We extendMeterDocumentation
however to add more information. While it would be nice to have that shown by the generator, this is not the problem.The main issue is that the generator doesn't pick up enums implementing the extending interface, it only picks up enums which directly implement
MeterDocumentation
.Take the following
ExtendedMeterDocumentation
interface:And the following enum:
Naively, I would expect the generator to pick up
MyMetrics
, but it does not.As a workaround, I can do the following:
Then the generator will pick it up. It would be great though if it wasn't necessary to again declare the implementation of
MeterDocumentation
.I'm happy to pick this up if you think this would be valuable. I understand there's not much urgency if there is a workaround :)
The text was updated successfully, but these errors were encountered: