loadInteractionDataInRange

abstract suspend fun loadInteractionDataInRange(userId: String, startTime: Long, endTime: Long): List<InteractionDataEntity>(source)

Retrieves interaction data within a specific time range for temporal analysis.

This method enables sophisticated temporal analysis by providing filtered access to interaction data within specified time boundaries. The timestamp-based filtering supports various analytical scenarios including time-series analysis, behavioral pattern detection during specific periods, and performance correlation studies.

Temporal Analysis Capabilities:

  • Precise time range filtering for targeted behavioral analysis

  • Chronological ordering maintains temporal sequence integrity

  • Flexible boundary specification supports various analytical time windows

Performance Optimization:

  • Composite index on (userId, timestamp) ensures efficient range queries

  • Boundary-based filtering minimizes data transfer and memory usage

  • Query planner optimization for timestamp range operations

Use Cases:

  • Performance correlation analysis during specific time periods

  • Behavioral pattern detection within defined temporal windows

  • A/B testing analysis with time-based cohort segmentation

  • System performance monitoring and diagnostic correlation

Query Precision:

  • Inclusive boundary conditions for precise temporal matching

  • Millisecond-level timestamp precision for fine-grained analysis

  • Time zone consistency maintained throughout the analysis pipeline

Return

List of interaction entities within the specified time range, ordered by timestamp (newest first)

Parameters

userId

Unique identifier for the user whose interactions should be analyzed

startTime

Inclusive start timestamp for the analysis window (Unix timestamp in milliseconds)

endTime

Inclusive end timestamp for the analysis window (Unix timestamp in milliseconds)

See also

Structure of returned interaction data

Method for recent interaction access without time constraints

Method for complete interaction history retrieval

Throws

SQLException

If database query execution fails

IllegalArgumentException

If startTime is greater than endTime or timestamps are negative

ValidationException

If timestamp values exceed supported date ranges