Package io.meeds.analytics.api.service
Interface AnalyticsService
public interface AnalyticsService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddUIWatcher(StatisticWatcher uiWatcher) computeChartData(AnalyticsFilter filter) Retrieve analytics chart datacomputePercentageChartData(AnalyticsFilter filter, AnalyticsPeriod currentPeriod, AnalyticsPeriod previousPeriod, boolean hasLimitAggregation) Retrieve analytics percentage chart dataRetrieve analytics percentage chart datacomputeTableColumnData(TableColumnResult columnResult, AnalyticsTableFilter tableFilter, AnalyticsFilter filter, AnalyticsPeriod period, AnalyticsPeriodType periodType, int columnIndex, boolean isValue) Retrieve analytics table datagetChart(List<String> operations, String fieldName, List<String> fieldValues, String xAggregationField, AnalyticsAggregationType xAggregationType, String xAggregationSortDirection, String yAggregationField, AnalyticsAggregationType yAggregationType, String yAggregationSortDirection, int limit) getSamples(List<String> operations, String fieldName, List<String> fieldValues, String sortBy, String sortDirection, int limit) getUIWatcher(String name) retrieveData(AnalyticsFilter searchFilter) Retrieve data using search filtersretrieveFieldValues(String field, int limit) Retrieve values of a selected fieldretrieveMapping(boolean forceRefresh)
-
Method Details
-
computeChartData
Retrieve analytics chart data- Parameters:
filter- used search filters and aggregations to compute data- Returns:
- computed analytics chart data
-
computePercentageChartData
Retrieve analytics percentage chart data- Parameters:
filter- used search filters and aggregations to compute data- Returns:
- computed analytics chart data
-
computeTableColumnData
TableColumnResult computeTableColumnData(TableColumnResult columnResult, AnalyticsTableFilter tableFilter, AnalyticsFilter filter, AnalyticsPeriod period, AnalyticsPeriodType periodType, int columnIndex, boolean isValue) Retrieve analytics table data- Parameters:
columnResult- existing column result to use for result comptuingtableFilter- overall configured table filterfilter- used search filters and aggregations to compute dataperiod- selectedAnalyticsPeriodperiodType- selectedAnalyticsPeriodTypecolumnIndex- column index in the configured table filterisValue- whether the filter to compute is for value or threshold- Returns:
- computed analytics table column data
-
computePercentageChartData
PercentageChartValue computePercentageChartData(AnalyticsFilter filter, AnalyticsPeriod currentPeriod, AnalyticsPeriod previousPeriod, boolean hasLimitAggregation) Retrieve analytics percentage chart data- Parameters:
filter- used search filters and aggregations to compute datacurrentPeriod- current period of timepreviousPeriod- previous period of time to compare withhasLimitAggregation- whether aggregations has limit aggregation or not- Returns:
PercentageChartValuecontaining current and previous values and thresholds
-
retrieveData
Retrieve data using search filters- Parameters:
searchFilter-- Returns:
ListofStatisticData
-
retrieveMapping
- Parameters:
forceRefresh- whether force refresh from ES or not- Returns:
- a
Setof ES mapping fields
-
retrieveFieldValues
Retrieve values of a selected field- Parameters:
field- name of esFieldlimit- limit of results to retrieve- Returns:
Listof field values of typeStatisticFieldValue
-
getAdministratorsPermissions
- Returns:
- the analytics permission expression
-
getViewAllPermissions
- Returns:
- the
Listof permission expression of users that can access all analytics datas
-
getViewPermissions
- Returns:
- the
Listof permission expression of users that can access their (and their spaces they are member of) analytics datas
-
getUIWatchers
List<StatisticWatcher> getUIWatchers()- Returns:
ListofStatisticWatchercontaining DOM selectors of elements to watch
-
getUIWatcher
- Parameters:
name- corresponding UI watcher name, see StatisticWatcher#getName()- Returns:
StatisticWatcherhaving switch corresponding name
-
addUIWatcher
- Parameters:
uiWatcher-StatisticWatchercontaining DOM selector of elements to watch
-
getSamples
List<StatisticData> getSamples(List<String> operations, String fieldName, List<String> fieldValues, String sortBy, String sortDirection, int limit) - Parameters:
operations- (Optional)Listof collected operations to considerfieldName- (Optional) Field Name to filterfieldValues- (Optional) Field values to filtersortBy- Sort field namesortDirection- Sort direction: asc or desclimit- limit of results to retrieve- Returns:
ListofStatisticDatarepresenting the collected data
-
getChart
ChartDataList getChart(List<String> operations, String fieldName, List<String> fieldValues, String xAggregationField, AnalyticsAggregationType xAggregationType, String xAggregationSortDirection, String yAggregationField, AnalyticsAggregationType yAggregationType, String yAggregationSortDirection, int limit) - Parameters:
operations- (Optional)Listof collected operations to considerfieldName- (Optional) Field Name to filterfieldValues- (Optional) Field values to filterxAggregationField- x axis fieldxAggregationType- x axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAMxAggregationSortDirection- sort direction: asc or descyAggregationField- y axis fieldyAggregationType- y axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAMyAggregationSortDirection- sort direction: asc or desclimit- limit of x Axis results to retrieve- Returns:
- ChartDataList
-