-
Notifications
You must be signed in to change notification settings - Fork 304
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
PAYARA-3830 Microprofile Metrics 2.0 #4076
Conversation
TCK fails though
Current TCK status - 71 pass, 21 fail, 51 error, 143 total
Currently: Tests run: 146, Failures: 8, Errors: 6
Failing tests: 7
5 failures
Jenkins test please |
...s/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsHelper.java
Outdated
Show resolved
Hide resolved
...s/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsHelper.java
Show resolved
Hide resolved
...file/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/producer/MetricProducer.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/MBeanMetadataHelper.java
Outdated
Show resolved
Hide resolved
...icroprofile/metrics/src/main/java/fish/payara/microprofile/metrics/rest/MetricsResource.java
Outdated
Show resolved
Hide resolved
...rofile/metrics/src/main/java/fish/payara/microprofile/metrics/writer/JsonMetadataWriter.java
Outdated
Show resolved
Hide resolved
0c0e610
to
70c028d
Compare
Jenkins test please |
Jenkins test please |
requires payara/Payara_PatchedProjects#257 to be merged first |
Jenkins test please |
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.
Fine apart from me being picky
...s/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsHelper.java
Outdated
Show resolved
Hide resolved
...s/common/glassfish-api/src/main/java/org/glassfish/api/invocation/InvocationManagerImpl.java
Outdated
Show resolved
Hide resolved
...rofile/metrics/src/main/java/fish/payara/microprofile/metrics/writer/JsonMetadataWriter.java
Outdated
Show resolved
Hide resolved
...ver-modules/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/Tag.java
Outdated
Show resolved
Hide resolved
...profile/metrics/src/main/java/fish/payara/microprofile/metrics/impl/ConcurrentGaugeImpl.java
Outdated
Show resolved
Hide resolved
Jenkins test please |
...s/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsHelper.java
Outdated
Show resolved
Hide resolved
...s/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsHelper.java
Outdated
Show resolved
Hide resolved
if (splitIndex == -1) { | ||
throw new IllegalArgumentException("invalid tag: " + stringtags[i] + ", tags must be in the form key=value"); | ||
} else { | ||
tags[i] = new Tag(stringtags[i].substring(0, splitIndex), stringtags[i].substring(splitIndex + 1)); |
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 always love small independent methods, that can be unit tested, especially when they do any index access.
For example, what it returns for tagsFromString(new String[] {"key=value", "surprise="})
? ;)
...microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/cdi/MetricsResolver.java
Show resolved
Hide resolved
...c/main/java/fish/payara/microprofile/metrics/cdi/interceptor/ConcurrentGuageInterceptor.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/impl/MetricRegistryImpl.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/impl/MetricRegistryImpl.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/MBeanMetadataHelper.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/MBeanMetadataHelper.java
Outdated
Show resolved
Hide resolved
...ver-modules/microprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/Tag.java
Outdated
Show resolved
Hide resolved
...oprofile/metrics/src/main/java/fish/payara/microprofile/metrics/jmx/MBeanMetadataHelper.java
Outdated
Show resolved
Hide resolved
...icroprofile/metrics/src/main/java/fish/payara/microprofile/metrics/rest/MetricsResource.java
Outdated
Show resolved
Hide resolved
Changes were requested by Patrik and Gaurav
b512488
to
88ddcdb
Compare
Jenkins test please |
import org.eclipse.microprofile.metrics.Timer; | ||
import org.eclipse.microprofile.metrics.annotation.Metric; | ||
|
||
@ApplicationScoped | ||
public class MetricsHelper { | ||
|
||
@ConfigProperty(name="mp.metrics.tags") | ||
String globalTags; |
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.
It's not required to define this property, is it?
In such case, I believe, you must inject Optional<String>
to prevent injection failures.
@@ -67,34 +69,95 @@ | |||
|
|||
@Produces | |||
private Counter counter(InjectionPoint ip) { | |||
return registry.counter(helper.metadataOf(ip, Counter.class)); | |||
Metric annotation = ip.getAnnotated().getAnnotation(Metric.class); | |||
if (annotation != null) { |
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 see some method to be extracted here. This block could be extracted and reused in downward methods, but it's type definition would be horrendous (T register(BiFunction<Metadata,Tag[],T> factory1,BiFunction<String,Tag[]> factory2, .Function<String,T> factory3)
... actually I was expecting to type much more).
You could at least extract the condition, and the construction of default name into their own methods
...c/main/java/fish/payara/microprofile/metrics/cdi/interceptor/ConcurrentGuageInterceptor.java
Outdated
Show resolved
Hide resolved
fbf02b5
to
91d7d20
Compare
Jenkins test please |
Tests
payara/MicroProfile-TCK-Runners#50