Class JiraRuleInsightStore
java.lang.Object
com.codebarrel.jira.plugin.automation.store.JiraRuleInsightStore
- All Implemented Interfaces:
RuleInsightStore
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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 instantgetInsights(TenantContext context, RollupType type, InsightFilter filter, InsightSort sort, int limit) Retrieves insight data aggregated by rulegetMostRecentInsightTime(Environment environment, RollupType type) Returns the time instant of the last populated insightgetRuleExecutionState(Environment environment, Long ruleId, Instant created, Long auditId) Returns the state of the first statistic searched by rule ID and creation timegetTimeSeries(TenantContext context, RollupType type, InsightFilter filter) Retrieves insight data as time series datavoidpopulateInsights(Environment environment, RollupType type, Instant startInclusive, Instant endExclusive) Populates insights rollup data from the given start instant (inclusive) to the end (exclusive)voidremoveInsightsOlderThan(Environment environment, RollupType type, Instant olderThan) Removes insight rollup data for the given type and instantvoidupdateInsight(Environment environment, RollupType type, Long insightId, State state, Long auditId) Update the state of the given insight by its ID
-
Constructor Details
-
JiraRuleInsightStore
-
-
Method Details
-
populateInsights
public void populateInsights(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Instant startInclusive, @Nonnull Instant endExclusive) Description copied from interface:RuleInsightStorePopulates insights rollup data from the given start instant (inclusive) to the end (exclusive)- Specified by:
populateInsightsin interfaceRuleInsightStore- Parameters:
environment- Given instant environmenttype- Type of rollup to perform againststartInclusive- Instant to populate form (inclusive)endExclusive- Instant to populate to (exclusive)
-
updateInsight
public void updateInsight(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Long insightId, @Nonnull State state, @Nonnull Long auditId) Description copied from interface:RuleInsightStoreUpdate the state of the given insight by its ID- Specified by:
updateInsightin interfaceRuleInsightStore- Parameters:
environment- Given instant environmenttype- Type of rollup to perform againstinsightId- ID of the given insightstate- A new state to be set for a given insightauditId- Audit ID of the given insight
-
getRuleExecutionState
public Optional<String> getRuleExecutionState(@Nonnull Environment environment, @Nonnull Long ruleId, @Nonnull Instant created, @Nonnull Long auditId) Description copied from interface:RuleInsightStoreReturns the state of the first statistic searched by rule ID and creation time- Specified by:
getRuleExecutionStatein interfaceRuleInsightStore- Parameters:
environment- Given instant environmentruleId- Rule ID of a statistic we are looking forcreated- Creation time of a statistic we are looking forauditId- Audit ID of a statistic we are looking for- Returns:
- Statistic state in string or empty
-
getMostRecentInsightTime
public Optional<Instant> getMostRecentInsightTime(@Nonnull Environment environment, @Nonnull RollupType type) Description copied from interface:RuleInsightStoreReturns the time instant of the last populated insight- Specified by:
getMostRecentInsightTimein interfaceRuleInsightStore- Parameters:
environment- Given instant environmenttype- Type of rollup to perform against- Returns:
- Instant of the last populate insight or empty
-
getInsightCategoryDetailsEarlierThan
public org.apache.commons.lang3.tuple.Pair<List<RuleInsightDetails>,Long> getInsightCategoryDetailsEarlierThan(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull State category, @Nonnull Instant earlierThan, @Nonnull Instant startTime) Description copied from interface:RuleInsightStoreReturns the list of insight details for the given category, and earlier than the given time instant- Specified by:
getInsightCategoryDetailsEarlierThanin interfaceRuleInsightStore- Parameters:
environment- Given instance environmenttype- Type of rollup to perform againstcategory- Category to useearlierThan- 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
public void removeInsightsOlderThan(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Instant olderThan) Description copied from interface:RuleInsightStoreRemoves insight rollup data for the given type and instant- Specified by:
removeInsightsOlderThanin interfaceRuleInsightStore- Parameters:
environment- Given instance environmenttype- Type of rollup to perform againstolderThan- Instant to remove rows older than (exclusive)
-
getInsights
public RuleInsightResult getInsights(@Nonnull TenantContext context, @Nonnull RollupType type, @Nonnull InsightFilter filter, @Nonnull InsightSort sort, int limit) Description copied from interface:RuleInsightStoreRetrieves insight data aggregated by rule- Specified by:
getInsightsin interfaceRuleInsightStore- Parameters:
context- Given instance environmenttype- Type of rollup to perform againstfilter- Filter query objectlimit- Number of rules results to return- Returns:
- Rule insight results
-
getTimeSeries
public TimeSeriesResult getTimeSeries(@Nonnull TenantContext context, @Nonnull RollupType type, @Nonnull InsightFilter filter) Description copied from interface:RuleInsightStoreRetrieves insight data as time series data- Specified by:
getTimeSeriesin interfaceRuleInsightStore- Parameters:
context- Given instance environmenttype- Type of rollup to perform againstfilter- Filter query object- Returns:
- Time series result with an entry for each time unit (including empty values)
-