gemmellr commented on code in PR #4911:
URL: https://github.com/apache/activemq-artemis/pull/4911#discussion_r1588019978


##########
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/MicrosClock.java:
##########
@@ -43,23 +45,28 @@ public static boolean isAvailable() {
    }
 
    public static long now() {
-      long epochSecond = offset;
-      long nanoAdjustment = 
jdk.internal.misc.VM.getNanoTimeAdjustment(epochSecond);
+      try {
+         long epochSecond = offset;
+         Class vm = Class.forName("jdk.internal.misc.VM");
+         Method getNanoTimeAdjustment = vm.getMethod("getNanoTimeAdjustment", 
long.class);
+         long nanoAdjustment = (long) 
getNanoTimeAdjustment.invoke(getNanoTimeAdjustment, epochSecond);

Review Comment:
   This might be better done once, e.g during the initial availability checks, 
and then the Method reused here rather than doing lookups every time, given the 
aimed usage ?



##########
artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile:
##########
@@ -37,7 +37,7 @@ HAWTIO_ROLE='${role}'
 
 # Java Opts
 if [ -z "$JAVA_ARGS" ]; then
-    JAVA_ARGS="-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC 
-XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} 
-Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true 
-Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal
 
-Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload
 -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml 
-Dlog4j2.disableJmx=true ${java-opts}"
+    JAVA_ARGS="-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC 
-XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} 
-Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true 
-Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal
 
-Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload
 -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml 
-Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED 
${java-opts}"

Review Comment:
   Hadnt actually considered this possibility...but if doing it, is there a 
windows equivalent needed somewhere?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to