tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1481279 - /tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java
Date Sat, 11 May 2013 18:01:17 GMT
2013/5/11  <rjung@apache.org>:
> Author: rjung
> Date: Sat May 11 09:38:02 2013
> New Revision: 1481279
>
> URL: http://svn.apache.org/r1481279
> Log:
> Diagnostics vmInfo:
> - sort logger names and system properties
> - add info about memory and GC
>
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java
>
> Modified: tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java?rev=1481279&r1=1481278&r2=1481279&view=diff
> ==============================================================================
(...)
> @@ -442,31 +478,107 @@ public class Diagnostics {
>                    compilationMXBean.isCompilationTimeMonitoringSupported() + CRLF);
>          sb.append(CRLF);
>
> -        sb.append(requestedSm.getString("diagnostics.vmInfoPath"));
> -        sb.append(":" + CRLF);
> -        sb.append(INDENT1 + "bootClassPath: " + runtimeMXBean.getBootClassPath() + CRLF);
> -        sb.append(INDENT1 + "classPath: " + runtimeMXBean.getClassPath() + CRLF);
> -        sb.append(INDENT1 + "libraryPath: " + runtimeMXBean.getLibraryPath() + CRLF);
> -        sb.append(CRLF);
> +        for (MemoryManagerMXBean mbean: memoryManagerMXBeans) {
> +            sb.append(requestedSm.getString("diagnostics.vmInfoMemoryManagers", mbean.getName()));

There is no such message "vmInfoMemoryManagers" in
LocalStrings.properties file, nor the new messages used below.

You forgot to commit, or it is just left as a TODO?


> +            sb.append(":" + CRLF);
> +            sb.append(INDENT1 + "isValid: " + mbean.isValid() + CRLF);
> +            sb.append(INDENT1 + "mbean.getMemoryPoolNames: " + CRLF);
> +            String[] names = mbean.getMemoryPoolNames();
> +            Arrays.sort(names);
> +            for (String name: names) {
> +                sb.append(INDENT2 + name + CRLF);
> +            }
> +            sb.append(CRLF);
> +        }
>
> -        sb.append(requestedSm.getString("diagnostics.vmInfoStartup"));
> +        for (GarbageCollectorMXBean mbean: garbageCollectorMXBeans) {
> +            sb.append(requestedSm.getString("diagnostics.vmInfoGarbageCollectors", mbean.getName()));
> +            sb.append(":" + CRLF);
> +            sb.append(INDENT1 + "isValid: " + mbean.isValid() + CRLF);
> +            sb.append(INDENT1 + "mbean.getMemoryPoolNames: " + CRLF);
> +            String[] names = mbean.getMemoryPoolNames();
> +            Arrays.sort(names);
> +            for (String name: names) {
> +                sb.append(INDENT2 + name + CRLF);
> +            }
> +            sb.append(INDENT1 + "getCollectionCount: " + mbean.getCollectionCount()
+ CRLF);
> +            sb.append(INDENT1 + "getCollectionTime: " + mbean.getCollectionTime() +
CRLF);
> +            sb.append(CRLF);
> +        }
> +
> +        sb.append(requestedSm.getString("diagnostics.vmInfoMemory"));
>          sb.append(":" + CRLF);
> -        for (String arg: runtimeMXBean.getInputArguments()) {
> -            sb.append(INDENT1 + arg + CRLF);
> +        sb.append(INDENT1 + "isVerbose: " + memoryMXBean.isVerbose() + CRLF);
> +        sb.append(INDENT1 + "getObjectPendingFinalizationCount: " + memoryMXBean.getObjectPendingFinalizationCount()
+ CRLF);
> +        sb.append(formatMemoryUsage("heap", memoryMXBean.getHeapMemoryUsage()));
> +        sb.append(formatMemoryUsage("non-heap", memoryMXBean.getNonHeapMemoryUsage()));
> +        sb.append(CRLF);
> +
> +        for (MemoryPoolMXBean mbean: memoryPoolMXBeans) {
> +            sb.append(requestedSm.getString("diagnostics.vmInfoMemoryPools", mbean.getName()));
> +            sb.append(":" + CRLF);
> +            sb.append(INDENT1 + "isValid: " + mbean.isValid() + CRLF);
> +            sb.append(INDENT1 + "getType: " + mbean.getType() + CRLF);
> +            sb.append(INDENT1 + "mbean.getMemoryManagerNames: " + CRLF);
> +            String[] names = mbean.getMemoryManagerNames();
> +            Arrays.sort(names);
> +            for (String name: names) {
> +                sb.append(INDENT2 + name + CRLF);
> +            }
> +            sb.append(INDENT1 + "isUsageThresholdSupported: " + mbean.isUsageThresholdSupported()
+ CRLF);
> +            try {
> +                sb.append(INDENT1 + "isUsageThresholdExceeded: " + mbean.isUsageThresholdExceeded()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            sb.append(INDENT1 + "isCollectionUsageThresholdSupported: " + mbean.isCollectionUsageThresholdSupported()
+ CRLF);
> +            try {
> +                sb.append(INDENT1 + "isCollectionUsageThresholdExceeded: " + mbean.isCollectionUsageThresholdExceeded()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            try {
> +                sb.append(INDENT1 + "getUsageThreshold: " + mbean.getUsageThreshold()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            try {
> +                sb.append(INDENT1 + "getUsageThresholdCount: " + mbean.getUsageThresholdCount()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            try {
> +                sb.append(INDENT1 + "getCollectionUsageThreshold: " + mbean.getCollectionUsageThreshold()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            try {
> +                sb.append(INDENT1 + "getCollectionUsageThresholdCount: " + mbean.getCollectionUsageThresholdCount()
+ CRLF);
> +            } catch (UnsupportedOperationException ex) {
> +                // IGNORE
> +            }
> +            sb.append(formatMemoryUsage("current", mbean.getUsage()));
> +            sb.append(formatMemoryUsage("collection", mbean.getCollectionUsage()));
> +            sb.append(formatMemoryUsage("peak", mbean.getPeakUsage()));
> +            sb.append(CRLF);
>          }
> -        sb.append(CRLF);
> +
>
>          sb.append(requestedSm.getString("diagnostics.vmInfoSystem"));
>          sb.append(":" + CRLF);
>          Map<String,String> props = runtimeMXBean.getSystemProperties();
> -        for (String prop: props.keySet()) {
> +        ArrayList<String> keys = new ArrayList<String>(props.keySet());
> +        Collections.sort(keys);
> +        for (String prop: keys) {
>              sb.append(INDENT1 + prop + ": " + props.get(prop) + CRLF);
>          }
>          sb.append(CRLF);
>
>          sb.append(requestedSm.getString("diagnostics.vmInfoLogger"));
>          sb.append(":" + CRLF);
> -        for (String logger: loggingMXBean.getLoggerNames()) {
> +        List<String> loggers = loggingMXBean.getLoggerNames();
> +        Collections.sort(loggers);
> +        for (String logger: loggers) {
>              sb.append(INDENT1 + logger +
>                        ": level=" + loggingMXBean.getLoggerLevel(logger) +
>                        ", parent=" + loggingMXBean.getParentLoggerName(logger) + CRLF);
>
>


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message