Lightrun Metrics overview🔗
Lightrun lets you acquire, in real-time, a broad range of performance metrics for timing, synchronization, and business logic. These metrics provide immediate answers for identifying bottlenecks, with minimal impact on performance.
Lightrun supports the following metric types: Counter, Method duration, Tic & Toc (Block Duration), and custom metrics.
Support and Retention
- Metrics currently are supported only for Java/JVM applications.
- From release 1.39, metrics are retained for 10 days after they expire. Following this period, the expired metrics are automatically deleted.
Typical use cases for metrics🔗
With Lightrun Metrics, you can:
- Add metrics, on demand, to your running application code, until you identify the problem
- Count line execution occurrences
- Swiftly identify performance and synchronization issues in the same version you released
- Use timers, Tic & Toc function durations, and custom metrics, to investigate code behavior and measure performance
- Collect system statistics on latency, throughput, and other variables
Supported Lightrun Metric types🔗
Counter metric🔗
A Lightrun Counter is added to a single line of code. It counts the number of times the code line is reached. You can add a counter to any and as a many lines of code you need. From the Lightrun IDE plugin, you can specify the conditions (as Boolean expressions) when to record the line execution.
Method Duration metric🔗
The Method Duration metric measures the elapsed time for executing a given method. In the JetBrains plugin, you can optionally configure Method Duration metrics to capture a snapshot when the measured duration exceeds a defined threshold.
Tic & Toc (Block Duration) metric🔗
The Lightrun Tic & Toc metric measures the elapsed time for executing a specified block of code, within the same function. In the JetBrains plugin, you can optionally configure Tic & Toc metrics to capture a snapshot when the measured duration exceeds a defined threshold.
Custom metric🔗
Lightrun enables you to design your own custom metric, using conditional expressions that evaluate to an int or double result. double is supported starting with 1.81. Custom metrics can be created using the configuration form in the Lightrun IDE plugin or from the Lightrun CLI.
Threshold-triggered snapshots for time-based metrics🔗
For Method Duration and Tic & Toc metrics, you can optionally configure Lightrun to automatically capture a snapshot when the measured duration exceeds a defined threshold.
This helps you investigate slow executions by combining metric data with snapshot context, including local variables and source location, without manually adding a separate snapshot action.
Availability
Threshold-triggered snapshots for metrics are available from Lightrun version 1.87, only in the JetBrains plugin for Java/JVM applications.
This capability applies only to Method Duration and Tic & Toc metrics. It is not available for Counter or Custom Metric actions.
Start using Lightrun Metrics🔗
- Create and manage Lightrun Metrics in the JetBrains IDE
- Create and manage metrics in the VS Code plugin