Skip to main content
Version: 1.11.0

Metrics

Storm exposes runtime metrics through JMX (Java Management Extensions) MBeans. These metrics give you visibility into template compilation performance, dirty checking behavior, and entity cache efficiency. All MBeans are registered automatically when Storm initializes and aggregate across all ORMTemplate instances in the JVM.

To view these metrics, connect to the JVM with any JMX client (JConsole, VisualVM, or your monitoring platform) and navigate to the st.orm domain. If your application uses Spring Boot Actuator, the MBeans are also accessible through Actuator's JMX endpoint.


Template Metrics

MBean name: st.orm:type=TemplateMetrics

Storm compiles SQL templates into reusable prepared statement shapes. This compilation step resolves aliases, derives joins, and expands column lists. The template cache avoids repeating this work for the same query pattern with different parameter values. These metrics help you understand whether the cache is effective.

Available Attributes

AttributeDescription
RequestsTotal number of template requests
HitsNumber of cache hits
MissesNumber of cache misses
HitRatioPercentHit ratio as a percentage (0-100)
AvgRequestMicrosAverage request duration in microseconds
MaxRequestMicrosMaximum request duration in microseconds
AvgHitMicrosAverage cache hit duration in microseconds
MaxHitMicrosMaximum cache hit duration in microseconds
AvgMissMicrosAverage cache miss duration in microseconds
MaxMissMicrosMaximum cache miss duration in microseconds

A high HitRatioPercent (above 95%) indicates the cache is working well. If you see frequent misses, your application may have many dynamically constructed query patterns. Consider increasing the cache size via storm.template_cache.size (see Configuration) or reducing the number of distinct query shapes.

Operations

OperationDescription
reset()Resets all counters to zero

Dirty Check Metrics

MBean name: st.orm:type=DirtyCheckMetrics

Dirty checking determines whether an UPDATE statement is sent to the database and which columns it includes. These metrics aggregate across all dirty checks performed by entity repositories, giving you visibility into how often updates are skipped, which resolution paths are taken, and how your max_shapes budget is being used. For background on how dirty checking works, see Dirty Checking.

Entity-Level Counters

AttributeDescription
ChecksTotal number of dirty checks performed
CleanNumber of checks that found the entity unchanged (update skipped)
DirtyNumber of checks that found the entity changed (update triggered)
CleanRatioPercentPercentage of checks where the update was skipped (0-100)

A high CleanRatioPercent indicates that many updates are avoided because the entity has not changed since it was read. If this ratio is low and your application frequently calls update() on unmodified entities, consider reviewing your update logic.

Resolution Path Counters

AttributeDescription
IdentityMatchesChecks resolved by identity comparison (cached == entity), the cheapest path
CacheMissesChecks where no cached baseline was available, causing a fallback to full-entity update

High CacheMisses may indicate that the entity cache is being cleared prematurely. Consider switching from light to default cache retention if cache misses are frequent. See Entity Cache for details.

Mode and Strategy Breakdown

AttributeDescription
EntityModeChecksChecks that used ENTITY update mode (full-row UPDATE on any change)
FieldModeChecksChecks that used FIELD update mode (column-level UPDATE)
InstanceStrategyChecksChecks that used INSTANCE strategy (identity-based field comparison)
ValueStrategyChecksChecks that used VALUE strategy (equality-based field comparison)

Field-Level Counters

AttributeDescription
FieldComparisonsTotal number of individual field comparisons across all dirty checks
FieldCleanNumber of field comparisons where the field was unchanged
FieldDirtyNumber of field comparisons where the field was different

Shape Counters

AttributeDescription
EntityTypesNumber of distinct entity types that have generated UPDATE shapes
ShapesTotal number of distinct UPDATE statement shapes across all entity types
ShapesPerEntityMap of entity type name to the number of shapes for that type

Compare ShapesPerEntity values against the configured storm.update.max_shapes to determine if any entity type is exhausting its shape budget. When the limit is reached, Storm falls back to full-row updates for that entity type.

Per-Entity Configuration

AttributeDescription
UpdateModePerEntityMap of entity type name to effective update mode (FIELD, ENTITY, OFF)
DirtyCheckPerEntityMap of entity type name to effective dirty check strategy (INSTANCE, VALUE)
MaxShapesPerEntityMap of entity type name to configured max shapes limit

Operations

OperationDescription
reset()Resets all counters to zero

Entity Cache Metrics

MBean name: st.orm:type=EntityCacheMetrics

Storm maintains a transaction-scoped entity cache that ensures the same database row maps to the same object instance within a single transaction. These metrics aggregate across all transaction-scoped entity caches, providing visibility into cache hit rates, eviction patterns, and retention behavior. For background on how the cache works, see Entity Cache.

Lookup Counters

AttributeDescription
GetsTotal number of get() calls (cache lookups)
GetHitsNumber of lookups that returned a cached entity
GetMissesNumber of lookups where no cached entity was available
GetHitRatioPercentGet hit ratio as a percentage (0-100)

A low GetHitRatioPercent in combination with frequent update() calls suggests that entities are being evicted before they can serve as dirty-check baselines. Consider switching to default cache retention.

Intern Counters

AttributeDescription
InternsTotal number of intern() calls (cache insertions)
InternHitsNumber of intern calls that reused an existing canonical instance
InternMissesNumber of intern calls that stored a new or updated instance
InternHitRatioPercentIntern hit ratio as a percentage (0-100)

Lifecycle Counters

AttributeDescription
RemovalsNumber of cache entries removed due to entity mutations (insert, update, delete)
ClearsNumber of full cache clears
EvictionsNumber of cache entries cleaned up after garbage collection

High Evictions values indicate that entities are being garbage collected while still in the cache. This is expected with light retention but unusual with default retention unless the JVM is under memory pressure.

Per-Entity Configuration

AttributeDescription
RetentionPerEntityMap of entity type name to effective retention mode (DEFAULT, LIGHT)

Operations

OperationDescription
reset()Resets all counters to zero