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
InternalLogger.INSTANCE.error("Error initializing JNI Performance Counter library. Windows performance counters will not be used.: "+ ExceptionUtils.getStackTrace(e));
82
+
}
78
83
} catch (Throwablee) {
79
84
try {
80
-
InternalLogger.INSTANCE.error(
81
-
"Failed to load native dll, Windows performance counters will not be used. " +
82
-
"Please make sure that Visual C++ Redistributable is properly installed: %s.", e.toString());
85
+
if (InternalLogger.INSTANCE.isErrorEnabled()) {
86
+
InternalLogger.INSTANCE.error("Unexpected error initializing JNI Performance Counter library. Windows performance counters will not be used: "+ExceptionUtils.getStackTrace(e));
87
+
}
83
88
84
89
returnfalse;
85
90
} catch (ThreadDeathtd) {
@@ -150,14 +155,26 @@ public static double getValueOfPerformanceCounter(String name) {
150
155
returngetPerformanceCounterValue(name);
151
156
}
152
157
158
+
/**
159
+
* Performance Counters identify a process by "Instance Name."
160
+
* This will be the executable name without the extension, e.g. a process running java.exe will have an instance name "java".
161
+
* If there are multiple instances of the same executable, an additional identifier is appended. By default this looks like "java#1", "java#2".
162
+
* For some reason, the instance name can change after the process starts with the default naming scheme.
163
+
*
164
+
* To workaround this, add a DWORD registry value named 'ProcessNameFormat' set to the value '2' to the key
* This changes the naming scheme from "java#2" to "java_PID" where PID is the current process id. It also makes the name constant for the life of the process.
167
+
*
168
+
* @throws NumberFormatException if pid cannot be parsed.
0 commit comments