Giter VIP home page Giter VIP logo

perfmon4j's People

Contributors

ddeuchert avatar dwatling avatar dwatling-follett avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dcfsc

perfmon4j's Issues

POJOSnapShotMonitor should not throw exception on failure to instrument method

Currently any @SnapShotGauge, @SnapShotCounter, or @SnapShotString annotations are expected to be put on a method starting with "get"

We should:

  1. Support "is" methods for boolean gauges.
  2. More importantly only WARN on not being able to instrument the method. Never throw an exception, simply ignore the method if all else fails.

Example of an exception:
Caused by: java.lang.RuntimeException: org.perfmon4j.instrument.snapshot.GenerateSnapShotException: Error generating SnapShotDataImpl
at api.org.perfmon4j.agent.POJOSnapShotRegistry.register(POJOSnapShotRegistry.java)
at api.org.perfmon4j.agent.POJOSnapShotRegistry.register(POJOSnapShotRegistry.java:20)
at com.follettsoftware.async.emailer.impl.EmailerSingletonImpl.(EmailerSingletonImpl.java:46)
... 31 more
Caused by: org.perfmon4j.instrument.snapshot.GenerateSnapShotException: Error generating SnapShotDataImpl
at org.perfmon4j.instrument.snapshot.JavassistSnapShotGenerator.generateSnapShotDataImpl(JavassistSnapShotGenerator.java:562)
at org.perfmon4j.instrument.snapshot.JavassistSnapShotGenerator.generateBundleForPOJO(JavassistSnapShotGenerator.java:581)
at org.perfmon4j.POJOSnapShotRegistry.buildRegistryEntry(POJOSnapShotRegistry.java:21)
at org.perfmon4j.GenericItemRegistry.register(GenericItemRegistry.java:33)
... 34 more
Caused by: java.lang.IllegalArgumentException: Invalid method expected expected to start with get
at org.perfmon4j.instrument.snapshot.JavassistSnapShotGenerator.generateFieldName(JavassistSnapShotGenerator.java:71)
at org.perfmon4j.instrument.snapshot.JavassistSnapShotGenerator.generateGauge(JavassistSnapShotGenerator.java:178)
at org.perfmon4j.instrument.snapshot.JavassistSnapShotGenerator.generateSnapShotDataImpl(JavassistSnapShotGenerator.java:494)
... 37 more

Log if perfmonconfig.xml disables the system

When the perfmonconfig.xml contains

 <Perfmon4JConfig enabled='false'>
 /// don't care
 </Perfmon4JConfig>

one cannot tell by reviewing the logs, since the instrumentation step is performed regardless of the setting.

Please log the value read each time the config file changes is detected.

Error in azure.LogAnalyticsAppender

Getting this exception in in 1.6.0-SNAPSHOT

23:42:00,002 ERROR [org.perfmon4j.SnapShotMonitor] (PerfMon.utilityTimer) Error appending snapshot data for monitor: Composite Memory Pool: java.lang.IllegalStateException: Timer already cancelled.
at java.base/java.util.Timer.sched(Timer.java:398)
at java.base/java.util.Timer.schedule(Timer.java:194)
at org.perfmon4j.azure.LogAnalyticsAppender.appendDataLine(LogAnalyticsAppender.java:210)
at org.perfmon4j.azure.LogAnalyticsAppender.outputData(LogAnalyticsAppender.java:231)
at org.perfmon4j.Appender.appendData(Appender.java:194)
at org.perfmon4j.SnapShotMonitor$MonitorTimerTask.failSafeRun(SnapShotMonitor.java:151)
at org.perfmon4j.util.FailSafeTimerTask.run(FailSafeTimerTask.java:31)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)

nonHeapMemMax vs XX:MaxMetaspaceSize

Hello,

We have our JVM running with XX:MaxMetaspaceSize set to '1024m', however, when looking at 'perfmon4j.log' we see the following values:

 nonHeapMemUsed........... 543.655 MB
 nonHeapMemCommitted...... 578.012 MB
 nonHeapMemMax............ 2280.000 MB
 nonHeapMemUsedCommitted.. 94.056%
 nonHeapMemUsedMax........ 23.845%

We are concerned with the size of nonHeapMemMax and that it seems to not be honoring the value set in XX:MaxMetaspaceSize. Or do we have a wrong understanding on this?

Thanks in advance for any comments.

Under Wildfly 21 perfmon4j log output is always through stdout.

Perfmon4j should switch to log4j output once it is available under Wildfly. However it does not and all output continues under stdout. This results in unwanted whitespace in the log file. Example from the text appender:

2021-06-28 15:00:32   INFO    stdout   ()   
2021-06-28 15:00:32   INFO    stdout   ()   ********************************************************************************
2021-06-28 15:00:32   INFO    stdout   ()   Job Manager
2021-06-28 15:00:32   INFO    stdout   ()   14:55:29:102 -> 15:00:29:092
2021-06-28 15:00:32   INFO    stdout   ()    runningJobCount.......... 1
2021-06-28 15:00:32   INFO    stdout   ()    runningJobNames.......... UpdateJob
2021-06-28 15:00:32   INFO    stdout   ()    maximumJobCount.......... 30
2021-06-28 15:00:32   INFO    stdout   ()    activeWrapperThreads..... 1
2021-06-28 15:00:32   INFO    stdout   ()    runningJobletNames....... No running joblets
2021-06-28 15:00:32   INFO    stdout   ()    runningJobletCount....... 0
2021-06-28 15:00:32   INFO    stdout   ()    serverActivityLevel...... 0.000
2021-06-28 15:00:32   INFO    stdout   ()   ********************************************************************************

When correctly output through log4j this should look like:

2021-06-29 09:59:26   INFO    TextAppender   ()   
********************************************************************************
Job Manager
09:54:24:050 -> 09:59:24:053
 runningJobCount.......... 0
 maximumJobCount.......... 30
 runningJobNames.......... No running jobs
 runningJobletCount....... 0
 serverActivityLevel...... 0.000
 runningJobletNames....... No running joblets
 activeWrapperThreads..... 0
********************************************************************************

Security warning verify and fix

See alert

2 io.undertow:undertow-core vulnerabilities found in wildfly8/pom.xml 3 days ago

Remediation

Upgrade io.undertow:undertow-core to version 1.3.31 or later. For example:

<dependency>
  <groupId>io.undertow</groupId>
  <artifactId>undertow-core</artifactId>
  <version>[1.3.31,)</version>
</dependency>

Always verify the validity and compatibility of suggestions with your codebase.

Issues

CVE-2017-2666

  • high severity
  • Vulnerable versions: < 1.3.31
  • Patched version: 1.3.31

It was discovered in Undertow that the code that parsed the HTTP request line permitted invalid characters. This could be exploited, in conjunction with a proxy that also permitted the invalid characters but with a different interpretation, to inject data into the HTTP response. By manipulating the HTTP response the attacker could poison a web-cache, perform an XSS attack, or obtain sensitive information from requests other than their own.

CVE-2017-2670

  • moderate severity
  • Vulnerable versions: < 1.3.28
  • Patched version: 1.3.28

It was found in Undertow before 1.3.28 that with non-clean TCP close, the Websocket server gets into infinite loop on every IO thread, effectively causing DoS.

POJOSnapShotRegistry should accept derived class where ancestor is annotated with @SnapShotPOJO

Currently it is an error to register a POJOSnapShot class if it does not have a SnapShotPOJO. We should accept registration of the class is derived from a parent (or ancestor) that has the @SnapShotPOJO anotation.

For example, in the following you should be able to successfully register the SpecializedSingleton.

@SnapShotPOJO
public class MySingleton {
...
   @SnapShotGauge
   public in getCreateCount() {
      return ...;
}

public class SpecializedSingleton extends MySingleton {
}
`

Error: no main manifest attribute in perfmon4j-dbupgrader

Trying to create a new Azure SQL DB from Linux using 1.5.1

$ java -jar /tmp/perfmon4j-dbupgrader-1.5.1.jar driverJarFile=./lib/sqljdbc4-4.0.jar  \
    driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver  \
    jdbcURL=jdbc:sqlserver://xxx.database.windows.net:2012;DatabaseName=perfmondb;userName=admin \
   password=xxxxxxx
no main manifest attribute, in /tmp/perfmon4j-dbupgrader-1.5.1.jar

Java:

$ java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (Zulu 8.40.0.25-CA-linux64) (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (Zulu 8.40.0.25-CA-linux64) (build 25.222-b10, mixed mode)

Could not load Logmanager "org.jboss.logmanager.LogManager" java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager

When attempting to start up our war file project under WildFly 26, in some environments we get the following error and the war file does not load in WildFly.

PerfMon4j will output logging to Log4j when service is available.
Perfmon4j will use embedded javassist.jar copied to temporary file (C:\Users\dlavin\AppData\Local\Temp\javassist.13190539460561794099.jar).  To use an external javassist.jar set system property "PERFMON4J_FORCE_EXTERNAL_JAVASSIST_JAR=true".
Perfmon4j using isolated javassist classloader.
 _____            __                      _  _   _ 
|  __ \          / _|                    | || | (_)
| |__) |___ _ __| |_ _ __ ___   ___  _ __| || |_ _ 
|  ___// _ \ '__|  _| '_ ` _ \ / _ \| '_ \__   _| |
| |   |  __/ |  | | | | | | | | (_) | | | | | | | |
|_|    \___|_|  |_| |_| |_| |_|\___/|_| |_| |_| | |
                                               _/ |
                                              |__/ 
To hide banner add "-DPerfmon4j.HideBanner=true" to your command line
Perfmon4j Instrumentation Agent v.1.6.0-rc.1 installed. (http://perfmon4j.org)
Perfmon4j found Javassist bytcode instrumentation library version: 3.27.0-GA
Perfmon4j high resolution timer is DISABLED. To enable add "-DPerfmon4j.UseHighResolutionMillis=true" to your command line
Perfmon4j transformer paramsString: -ecom.follett.fsc,-ecom.follett.fss,-acom.follett.fsc,-acom.follett.fss,-eSQL,-pAUTO,-eVALVE,-f../bin/perfmonconfig.xml
Perfmon4j verbose instrumentation logging disabled.  Add -vtrue to javaAgent parameters to enable.
Perfmon4j SQL instrumentation enabled.
Perfmon4j will attempt to install a Servlet Valve in Tomcat, JBoss or Wildfly Servers
In JBoss and Wildfly servers the Valve will NOT be installed until a Web Application is deployed
Perfmon4j will NOT attempt to install instrumentation into Hystrix Commands and Thread Pools.  If this application uses Hystrix add -eHYSTRIX to javaAgent parameters to enable.
Perfmon4j will attempt to install instrumentation into Hystrix Commands and Thread Pools
Perfmon4j bootstrap implementation disabled.  Add -btrue to javaAgent parameters to enable.
Loading perfmon configuration from file: G:\platforms\universal-search-wildfly26.1.3\wildfly\bin\perfmonconfig.xml
org.jboss.logmanager.LogManager found.  Will delay initial load of perfmon4j config for 5 seconds to allow JBoss time to load the LogManager
*** PerfMon4j remote management interface is scheduled to be instantiated in 30 seconds. To override delay duration add "-DPerfmon4j.RemoteInterfaceDelaySeconds=<number of seconds>" to your command line.
Could not load Logmanager "org.jboss.logmanager.LogManager"
java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at org.jboss.modules.JDKSpecific.getSystemClass(JDKSpecific.java:187)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:395)
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
	at java.logging/java.util.logging.LogManager$1.run(LogManager.java:239)
	at java.logging/java.util.logging.LogManager$1.run(LogManager.java:223)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at java.logging/java.util.logging.LogManager.<clinit>(LogManager.java:222)
	at org.jboss.modules.Main.main(Main.java:444)
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Loading configuration from: perfmonconfig.xml
Appender: "jdbc-appender" not defined. Attaching SnapShotMonitor "McFeelyThreadPool" to the default text appender with a one minute polling interval
No appenders defined for SnapShotMonitor "OldGen Memory Pool" attaching to the default text appender with a 1 minute polling interval.
PerfMon4j could not load the following resources: (SnapShotMonitor: com.follett.fss.mcfeely.perfmon.FetchThreadPoolSnapShot), (SnapShotMonitor: com.follett.fss.mcfeely.perfmon.FetchPolicySnapShot), (SnapShotMonitor: com.follett.fsc.cache.impl.perfmon4j.CacheSnapShot). Will try again in 60 seconds.
Perfmon4j management interface listening on port: 5400

Thanks for the help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.