@FunctionalInterface public interface JiraStatsListener
JiraStats
snapshot creation with total and snapshot data in raw form(nested maps with strings representations of stats values).
Main intended usage - sending stats data to analytics.
Can be applied whenever analytics event you want to send require same data with same structure as the stats you already have. For simplistic, low boilerplate way to send parts of actual stats data to jira analytics follow this instruction:
EventName
annotation) with 1 or 2
(depends whether you need snapshot data total data or both see JiraStats
) Map type fields
JiraStatsListener
and register it to ManagedStats
implementation of your interest
jira-analytics-whitelist-plugin-whitelist.json
. Be extra careful not to whitelist aynything that will become useless after analytics safety filters
(cutting our strings values and such) or might expose some customer internal data
onStats(Map, Map)
implementation simply instatiate your analytic event and send it via EventPublisher
Modifier and Type | Method and Description |
---|---|
void |
onStats(Map snapshotMap,
Map totalMap)
Both
snapshot and total might consist of nested maps - structure and names of the keys are derived from the particular ManagedStats implementation. |
void onStats(Map snapshotMap, Map totalMap)
snapshot
and total
might consist of nested maps - structure and names of the keys are derived from the particular ManagedStats
implementation.
Maps on each nesting level have string keys but can have either String value(for single value params) or nested Map(following the same content rules) representing more complex objects with many field.
Fields of simple types (like AtomicLong
map directly to records that have keys same as name of the field and the value as string the representation of fields value;
class FlatClassImplementation implements SomeManagedStatsInterface {
private AtomicLong field1;
private AtomicLong field2;
// no more fields
//rest of implementation
}
Will result with total/snapshot maps with keys "field1" and "field2", each pointing to a value containing string value of an integer
Fields of more complex types, composed of multiple fields (like MutableLongStats
are represented as nested maps, with same rules for content as top level map.
class TopClass implements SomeManagedStatsInterface{
private AtomicLong field1;
private EmbeddedClass field2;
// no more fields
// rest of implementation
}
class EmbeddedClass {
private AtomicLong field3;
private AtomicLong field4;
// no more fields
// rest of implementation
}
Call by stats TopClass will results with
Nesting can reach multiple levels, depending on the level of nesting in source stats objects.
snapshotMap
- - snapshot of stats values from recent periodtotalMap
- - stats values accumulated since the stat was instantiatedfor more about structure of {@link ManagedStats} implementation
Copyright © 2002-2022 Atlassian. All Rights Reserved.