public abstract class AnalyticsEvent extends Object
Can be applied whenever an analytics event you want to send has the same data with the same structure as the stats you already have.
AnalyticsEvent
(using EventName
annotation) with 1 or 2
(depends whether you need snapshot data total data or both see JiraStats
) Map type fields
jira-analytics-whitelist-plugin-whitelist.json
. Be extra careful not to whitelist anything that will become useless after analytics safety filters
(cutting out strings values and such) or might expose some customer internal data
AnalyticsSender.registerAnalyticsSender(com.atlassian.jira.util.stats.ManagedStats, com.atlassian.event.api.EventPublisher, java.util.function.BiFunction<java.util.Map, java.util.Map, com.atlassian.jira.analytics.AnalyticsEvent>)
to register your event with the ManagedStats
implementation of your interest. Eg.
Optional.ofNullable(register.getComponent(IndexingLimitsStats.class))
.ifPresent(stats -> AnalyticsSender.registerAnalyticsSender(stats, eventPublisher, IndexingLimitsStatsAnalyticsEvent::new));
JiraStats
,
ManagedStats
,
JiraStatsListener
,
for an example usage
Modifier | Constructor and Description |
---|---|
protected |
AnalyticsEvent(Map<Object,Object> snapshot,
Map<Object,Object> total)
Create an analytics event
|
Modifier and Type | Method and Description |
---|---|
Map<Object,Object> |
getSnapshot() |
Map<Object,Object> |
getTotal() |
protected AnalyticsEvent(@Nullable Map<Object,Object> snapshot, @Nullable Map<Object,Object> total)
snapshot
- snapshot of stats values from recent periodtotal
- stats values accumulated since the stat was instantiatedfor more information
Copyright © 2002-2024 Atlassian. All Rights Reserved.