spf4j | Simple performance framework for java | Monitoring library
kandi X-RAY | spf4j Summary
kandi X-RAY | spf4j Summary
IDE Preference: Netbeans. For Eclipse you need implemented for best experience. For InteliJ you need implemented for best experience. Build with Maven 3.5.2 Run maven with JDK 1.8. To build project all you need to do is: mvn install. Spf4j builds against [an avro fork] which is published to github repos. Until Github removes the authentication requirements, you will need to configure your authentication credentials in your settings.xml. ([see] the avro fork readme for more detail). Please use -Dgpg.skip=true argument is you do not have gpg installed or configured. You can run the spf4j unit tests with JDK 11 by activating the jdk-11-validation profile. (-P jdk-11-validation profile) please define java11.home property with the home of JDK 11 in your settings.xml. See pom.xml for other profiles for openjdk, zolyfarkas/avro fork validations.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns the JVM arguments .
- Project a list into a schema .
- Applies the given pattern .
- Adds the retry policy .
- Write the given schema to the appendable .
- Gets the javadoc executable .
- Write a single record .
- Helper method for logging i18n messages .
- Overrides the default values of the target schema with the given schema .
- Returns the number of runs that should be placed at the specified offset .
spf4j Key Features
spf4j Examples and Code Snippets
Community Discussions
Trending Discussions on spf4j
QUESTION
I have a number of REST API endpoints and I would like to measure the timing metrics for each separately. Annotating the methods with @PerformanceMonitor works, but the recorderSource field takes a class and there's no way to pass a unique forWhat
descriptor for each method. Do I need to create a child class for every endpoint + HTTP method just to define a unique forWhat
string? That does not seem scalable. Am I missing something?
Here's an example of a specific recorder source:
...ANSWER
Answered 2020-Jul-05 at 19:41If you use recorderSource=RecorderSourceInstance.Rs15m.class
The forWhat in your case will be "RecorderSourceInstance.Rs15m, YourClassName.getAllProducts"
So you would not need to create custom RecorderSourceInstance's for every method.
Another option you have is to measure your metrics at a lower level, in a servlet filter like at. This will get you a more complete picture of the server side execution time (will include ser/deser, io...).
You can see this metric in action at or in prometheus format. This live demo is running on GKE, and the source code is at. See the wiki's for more details on some of the ideas demonstrated in this demo.
QUESTION
I wrote a simple test to capture timing metrics using the SPF4J (Simple Profiler Framework For Java) MeasurementRecorder. I'm running a simple for loop and capturing time of a random sleep from 100-200 ms as shown in the complete code sample below.
When I run the test, the Time-Series DataBase (TSDB) files are created successfully, but they're empty while the test is running (around 2 mins). The buffered data are written to files when the application completes, but samples at the end are missing and the last one is truncated, like the buffer is not getting flushed properly.
If the application never terminates (e.g. web service), when will the buffered metrics be written to file - on a timer, or when a certain amount of data is buffered? Is this configurable and, if so, how?
...ANSWER
Answered 2020-Jul-04 at 09:48You will need to set the system property: spf4j.perf.ms.periodicFlush=true to enable the periodic flush.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spf4j
You can use spf4j like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spf4j component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page