Class StatisticsSummary
java.lang.Object
io.goobi.viewer.model.statistics.usage.StatisticsSummary
Summary of request counts for a certain date range. Used for delivering record counts to users
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionStatisticsSummary(DailySessionUsageStatistics dailyStats) Constructor to create an instance from aDailySessionUsageStatisticsobject.StatisticsSummary(DailySessionUsageStatistics dailyStats, List<String> includedIdentifiers) Constructor to create an instance from aDailySessionUsageStatisticsobject filtered by a list of record identifiers.Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionadd(StatisticsSummary other) Creates a new summary with the sum of request counts from this and another summary.static StatisticsSummaryempty()Creates an empty summary.getLastRecordedDate(RequestType... types) Gets the last date for which requests have been recorded.longgetTotalRequests(RequestType... types) Get the total amount for requests for a givenRequestType.getTypes()Get the request counts sorted byRequestType.longgetUniqueRequests(RequestType... types) Get the number of unique request for a givenRequestType.booleanisEmpty()booleanisOlderThan(long num, TemporalUnit unit) booleanisOlderThan(long num, TemporalUnit unit, Temporal currentTime) void
-
Constructor Details
-
StatisticsSummary
public StatisticsSummary() -
StatisticsSummary
Default constructor.- Parameters:
types- Request counts sorted byRequestType
-
StatisticsSummary
Constructor to create an instance from aDailySessionUsageStatisticsobject.- Parameters:
dailyStats- TheDailySessionUsageStatisticsfrom which to retrieve the request counts
-
StatisticsSummary
Constructor to create an instance from aDailySessionUsageStatisticsobject filtered by a list of record identifiers.- Parameters:
dailyStats- TheDailySessionUsageStatisticsfrom which to retrieve the request countsincludedIdentifiers- A list of record identifiers for which to count the requests. If empty, all requests will be counted
-
-
Method Details
-
empty
Creates an empty summary.- Returns:
- an empty
StatisticsSummary
-
getTypes
Get the request counts sorted byRequestType.- Returns:
- a
Map
-
add
Creates a new summary with the sum of request counts from this and another summary.- Parameters:
other- the otherSummaryStatisticsto add to this one- Returns:
- the sum of
SummaryStatistics
-
getTotalRequests
Get the total amount for requests for a givenRequestType.- Parameters:
types- theRequestTypes to count- Returns:
- number of requests
-
getUniqueRequests
Get the number of unique request for a givenRequestType.- Parameters:
types- theRequestTypes to count- Returns:
- number of unique requests
-
getLastRecordedDate
Gets the last date for which requests have been recorded.- Parameters:
types- theRequestTypeto check- Returns:
LocalDate
-
getAsCsv
-
calculateStartDate
-
calculateEndDate
-
isEmpty
public boolean isEmpty() -
setInformation
-
getInformation
-
isOlderThan
-
isOlderThan
-
getCreationTime
-