Interface RuleInsightStore

All Known Implementing Classes:
JiraRuleInsightStore

public interface RuleInsightStore
  • Method Details

    • populateInsights

      void populateInsights(Environment environment, RollupType type, Instant startInclusive, Instant endExclusive)
      Populates insights rollup data from the given start instant (inclusive) to the end (exclusive)
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      startInclusive - Instant to populate form (inclusive)
      endExclusive - Instant to populate to (exclusive)
    • updateInsight

      void updateInsight(Environment environment, RollupType type, Long insightId, State state, Long auditId)
      Update the state of the given insight by its ID
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      insightId - ID of the given insight
      auditId - Audit ID of the given insight
      state - A new state to be set for a given insight
    • getRuleExecutionState

      Optional<String> getRuleExecutionState(Environment environment, Long ruleId, Instant created, Long auditId)
      Returns the state of the first statistic searched by rule ID and creation time
      Parameters:
      environment - Given instant environment
      ruleId - Rule ID of a statistic we are looking for
      created - Creation time of a statistic we are looking for
      auditId - Audit ID of a statistic we are looking for
      Returns:
      Statistic state in string or empty
    • getMostRecentInsightTime

      Optional<Instant> getMostRecentInsightTime(Environment environment, RollupType type)
      Returns the time instant of the last populated insight
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      Returns:
      Instant of the last populate insight or empty
    • getInsightCategoryDetailsEarlierThan

      org.apache.commons.lang3.tuple.Pair<List<RuleInsightDetails>,Long> getInsightCategoryDetailsEarlierThan(Environment environment, RollupType type, State category, Instant earlierThan, Instant startTime)
      Returns the list of insight details for the given category, and earlier than the given time instant
      Parameters:
      environment - Given instance environment
      type - Type of rollup to perform against
      category - Category to use
      earlierThan - Instant to include rows earlier than (exclusive)
      startTime - Instant to include rows after than (exclusive)
      Returns:
      Pair of list of RuleInsightDetails objects which are within max duration allowed, it contains insight ID, rule ID, and creation time; and the count of insights that were outside of max time duration allowed
    • removeInsightsOlderThan

      void removeInsightsOlderThan(Environment environment, RollupType type, Instant olderThan)
      Removes insight rollup data for the given type and instant
      Parameters:
      environment - Given instance environment
      type - Type of rollup to perform against
      olderThan - Instant to remove rows older than (exclusive)
    • getInsights

      RuleInsightResult getInsights(TenantContext context, RollupType type, InsightFilter filter, InsightSort sort, int limit)
      Retrieves insight data aggregated by rule
      Parameters:
      context - Given instance environment
      type - Type of rollup to perform against
      filter - Filter query object
      limit - Number of rules results to return
      Returns:
      Rule insight results
    • getTimeSeries

      TimeSeriesResult getTimeSeries(TenantContext context, RollupType type, InsightFilter filter)
      Retrieves insight data as time series data
      Parameters:
      context - Given instance environment
      type - Type of rollup to perform against
      filter - Filter query object
      Returns:
      Time series result with an entry for each time unit (including empty values)