-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Closes #785 - Added autocompleter for declared metric names & fixed bug in ModelAutoCompleter #788
Conversation
Codecov Report
@@ Coverage Diff @@
## master #788 +/- ##
============================================
- Coverage 83.00% 82.91% -0.10%
- Complexity 1736 1759 +23
============================================
Files 174 178 +4
Lines 5366 5470 +104
Branches 650 658 +8
============================================
+ Hits 4454 4535 +81
- Misses 675 694 +19
- Partials 237 241 +4 |
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.
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @mbrill-nt)
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 13 at r1 (raw file):
import java.util.List; @Component
Small docs please :)
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 22 at r1 (raw file):
* The path under which metric names are defined. */ private final static List<String> METRICS_DECLARATION_PATH = Arrays.asList("inspectit", "instrumentation", "metrics");
This does not exist. The metrics are defined under the key inspectit.metrics.definitions
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 29 at r1 (raw file):
private static final List<List<String>> RULE_SUGGESTION_PATHS = Arrays.asList( METRICS_DECLARATION_PATH, Arrays.asList("inspectit", "instrumentation", "rules", "*", "metrics")
There is another place where you can use these suggestions. You can define them under the following key as well:
inspectit.instrumentation.rules.*.metrics.*.metric
inspectit-ocelot-config/src/main/java/rocks/inspectit/ocelot/config/validation/PropertyPathHelper.java, line 119 at r1 (raw file):
return ((Class<?>) type).isEnum() || ((Class<?>) type).isPrimitive() || InspectitConfigConversionService.getInstance().canConvert((Class<?>) type, String.class)
I think this is wrong. You can basically convert everything into a string..
As far as I understand this method, you want to check whether you can convert a simple string or number into an object, right?
inspectit-ocelot-config/src/test/java/rocks/inspectit/ocelot/config/validation/PropertyPathHelperTest.java, line 149 at r1 (raw file):
@Test public void convertibles() { boolean result = PropertyPathHelper.isTerminal(MetricRecordingSettings.class);
Please recheck whether this is correct. Why is isTerminal
returning true for this class? It's a complex type, basically a map, thus, returning true seems wrong because the property path is not terminating here (for example, the constant-tags
is defining more elements)
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.
Reviewable status: 1 of 4 files reviewed, 5 unresolved discussions (waiting on @mariusoe)
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 13 at r1 (raw file):
Previously, mariusoe (Marius Oehler) wrote…
Small docs please :)
Done.
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 22 at r1 (raw file):
Previously, mariusoe (Marius Oehler) wrote…
This does not exist. The metrics are defined under the key
inspectit.metrics.definitions
Done.
components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/autocomplete/autocompleterimpl/MetricsAutoCompleter.java, line 29 at r1 (raw file):
Previously, mariusoe (Marius Oehler) wrote…
There is another place where you can use these suggestions. You can define them under the following key as well:
inspectit.instrumentation.rules.*.metrics.*.metric
Done.
inspectit-ocelot-config/src/main/java/rocks/inspectit/ocelot/config/validation/PropertyPathHelper.java, line 119 at r1 (raw file):
Previously, mariusoe (Marius Oehler) wrote…
I think this is wrong. You can basically convert everything into a string..
As far as I understand this method, you want to check whether you can convert a simple string or number into an object, right?
I have talked to Jonas about this. You are right, the intention was to check if you can convert a string or a number into an object (which when thinking about it afterwards actually makes more sense). However the InspectionConfigConversionService is deprecated since it recognizes Strings and Numbers as being convertible to MetricRecordingSettings. As this is not the case anymore, Jonas suggested to use ApplicationConversionService instead.
inspectit-ocelot-config/src/test/java/rocks/inspectit/ocelot/config/validation/PropertyPathHelperTest.java, line 149 at r1 (raw file):
Previously, mariusoe (Marius Oehler) wrote…
Please recheck whether this is correct. Why is
isTerminal
returning true for this class? It's a complex type, basically a map, thus, returning true seems wrong because the property path is not terminating here (for example, theconstant-tags
is defining more elements)
This test tests for the result to be false. I have changed the name of the test to make that clearer.
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.
Reviewed 3 of 3 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
This change is