Class Fido2MetricsService
- Author:
- FIDO2 Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupOldData(int retentionDays) Cleanup old data based on retention policyvoidCreate daily aggregationvoidCreate hourly aggregationvoidCreate monthly aggregationvoidCreate weekly aggregationgetAggregations(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get aggregations by time range Uses interval overlap logic: finds aggregations that overlap with the query range An aggregation overlaps if: aggregation.startTime <= queryEndTime AND aggregation.endTime >= queryStartTimegetAggregationSummary(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get aggregation summary for a time periodgetAttestationRejectionAnalysis(LocalDateTime startTime, LocalDateTime endTime) Break down attestation rejections by trust diagnostic code over a time range.getDeviceAnalytics(LocalDateTime startTime, LocalDateTime endTime) Get device/platform analyticsgetErrorAnalysis(LocalDateTime startTime, LocalDateTime endTime) Get error analysis over both operation types.getErrorAnalysis(LocalDateTime startTime, LocalDateTime endTime, String operationType) Get error analysis, optionally for one operation type.getMetricsEntries(LocalDateTime startTime, LocalDateTime endTime) Get metrics entries by time rangegetMetricsEntriesByOperation(String operationType, LocalDateTime startTime, LocalDateTime endTime) Get metrics entries by operation typegetMetricsEntriesByUser(String userId, LocalDateTime startTime, LocalDateTime endTime) Get metrics entries by usergetPerformanceMetrics(LocalDateTime startTime, LocalDateTime endTime) Get performance metricsgetPeriodOverPeriodComparison(String aggregationType, int periods) Get period-over-period comparisongetTrendAnalysis(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get trend analysis for a specific aggregation type and time periodgetUserAdoptionMetrics(LocalDateTime startTime, LocalDateTime endTime) Get user adoption metrics.voidstoreMetricsData(Fido2MetricsData metricsData) Store metrics data as a metrics entryvoidStore a metrics entry asynchronously
-
Constructor Details
-
Fido2MetricsService
public Fido2MetricsService()
-
-
Method Details
-
storeMetricsEntry
Store a metrics entry asynchronously -
storeMetricsData
Store metrics data as a metrics entry -
getMetricsEntries
Get metrics entries by time range -
getMetricsEntriesByUser
public List<Fido2MetricsEntry> getMetricsEntriesByUser(String userId, LocalDateTime startTime, LocalDateTime endTime) Get metrics entries by user -
getMetricsEntriesByOperation
public List<Fido2MetricsEntry> getMetricsEntriesByOperation(String operationType, LocalDateTime startTime, LocalDateTime endTime) Get metrics entries by operation type -
createHourlyAggregation
Create hourly aggregation -
createDailyAggregation
Create daily aggregation -
createWeeklyAggregation
Create weekly aggregation -
createMonthlyAggregation
Create monthly aggregation -
getAggregations
public List<Fido2MetricsAggregation> getAggregations(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get aggregations by time range Uses interval overlap logic: finds aggregations that overlap with the query range An aggregation overlaps if: aggregation.startTime <= queryEndTime AND aggregation.endTime >= queryStartTime -
cleanupOldData
public void cleanupOldData(int retentionDays) Cleanup old data based on retention policy -
getUserAdoptionMetrics
Get user adoption metrics."New" and "returning" are decided against every successful registration on record, not just the rows inside
[startTime, endTime]: a user only counts as new the first time their registration succeeds, and as returning if they had already registered before the window began.adoptionRateis newUsers against the cumulative population of everyone who has ever registered as ofendTime— a self-contained figure bounded by how long metrics entries are retained, not a rate against the full identity directory. -
getPerformanceMetrics
Get performance metrics -
getDeviceAnalytics
Get device/platform analytics -
getErrorAnalysis
Get error analysis over both operation types. -
getErrorAnalysis
public Map<String,Object> getErrorAnalysis(LocalDateTime startTime, LocalDateTime endTime, String operationType) Get error analysis, optionally for one operation type.Pooling registration and authentication makes a deployment with healthy sign-in and poor enrolment indistinguishable from the reverse: both report the same middling success rate, and the two have different causes and different fixes. Pooling stays the default so existing callers see what they always have.
- Parameters:
operationType-Fido2MetricsConstants.REGISTRATIONorFido2MetricsConstants.AUTHENTICATIONto report that ceremony alone, or null to report both together
-
getAttestationRejectionAnalysis
public Map<String,Object> getAttestationRejectionAnalysis(LocalDateTime startTime, LocalDateTime endTime) Break down attestation rejections by trust diagnostic code over a time range.Reads the same metrics store as
getErrorAnalysis(java.time.LocalDateTime, java.time.LocalDateTime): a rejection is an entry whose error category isAttestationTrustDiagnostic.CATEGORY. No new store, no new collection path.- Parameters:
startTime- range startendTime- range end- Returns:
- counts per reason code and per AAGUID, plus the totals needed to interpret them
-
getTrendAnalysis
public Map<String,Object> getTrendAnalysis(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get trend analysis for a specific aggregation type and time period -
getPeriodOverPeriodComparison
Get period-over-period comparison -
getAggregationSummary
public Map<String,Object> getAggregationSummary(String aggregationType, LocalDateTime startTime, LocalDateTime endTime) Get aggregation summary for a time period
-