Class MetricRecordEntity

java.lang.Object
com.nmontytskyi.monitoring.server.entity.MetricRecordEntity

@Entity public class MetricRecordEntity extends Object
JPA entity representing a single point-in-time measurement for a microservice.

Records arrive via two channels:

  • PUSH — sent by the monitoring-spring-boot-starter AOP aspect after each intercepted HTTP request. Contains endpoint-level granularity (response time, status) but no system-level metrics (CPU, heap).
  • PULL — collected by the server-side scheduler via Actuator endpoints every 30 seconds. Contains service-level metrics (CPU, heap) but no endpoint granularity.

The anomaly and zScore fields are populated by AnomalyDetector immediately after the record is persisted.

Maps to the metric_records table. A composite index on (service_id, recorded_at DESC) supports efficient time-range and anomaly-window queries.

  • Constructor Details

    • MetricRecordEntity

      public MetricRecordEntity()