Spf4j (Simple performance framework for java)

Overview

The spf4j libraries is a collection of components designed to improve the observability and performance of java applications. The spf4j library covers the 3 pillars of observability (Logging, Metrics, Tracing) and adds a 4-th: Profiling. The goal of spf4j is to help with the right balance between observability data and observer effect.

Additionally this library contains useful components that are currently not available in the right form in other open source libraries (Retry/Hedged execution, object pool, test logging backend …) This library also contains ZEL, a simple expression language that can be easily embedded in any java application. ZEL is easy to extend to your needs and also has some cool features like async functions, memorization… You can learn more by checking out the spf4j-zel module.

License and Contributions

This library is LGPL and Apache 2.0 licensed.

Contributions/Contributors to spf4j are welcome, join the community: Gitter chat.

Code, Binaries, Build

SPF4J Github hosted repo

Maven Central Coverity Badge Quality Gate Codacy Badge CI badge

Architecture

Observability at any scale.

Monitoring Architecture

Architecture is similar to how air planes are being monitored, where the local storage is the functional equivalent of the black box, and its goal is to keep high resolution observability data for a limited amount of time. Just as with airplanes, lower resolution observability data should be sent in real time to a monitoring system. The monitoring system should be able to on demand “drill into” and get to the local detail(via /actuator).

Observing a system changes the system. The code in spf4j is carefully written to be high performance and to provide minimum overhead / functionality.

To achieve this we utilize:

  • Thread Local Counters for metrics, for a good evaluation see: Concurrent counters by numbers
  • Binary avro files for metrics. see
  • Binary avro files for logs and optimized log formatters and bridges. see for more detail.
  • ExecutionContext attributed profiling, see.