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
-
Constructor Summary
ConstructorDescriptionStatisticsSummary
(DailySessionUsageStatistics dailyStats) Constructor to create an instance from aDailySessionUsageStatistics
objectStatisticsSummary
(DailySessionUsageStatistics dailyStats, List<String> includedIdentifiers) Constructor to create an instance from aDailySessionUsageStatistics
object filtered by a list of record identifiersDefault constructor -
Method Summary
Modifier and TypeMethodDescriptionadd
(StatisticsSummary other) Create a new summary with the sum of request counts from this and another summarystatic StatisticsSummary
empty()
Create an empty summarygetLastRecordedDate
(RequestType... types) Get the last date for which requests have been recordedlong
getTotalRequests
(RequestType... types) Get the total amount for requests for a givenRequestType
getTypes()
Get the request counts sorted byRequestType
long
getUniqueRequests
(RequestType... types) Get the number of unique request for a givenRequestType
boolean
isEmpty()
boolean
isOlderThan
(long num, TemporalUnit unit) boolean
isOlderThan
(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 aDailySessionUsageStatistics
object- Parameters:
dailyStats
- TheDailySessionUsageStatistics
from which to retrieve the request counts
-
StatisticsSummary
Constructor to create an instance from aDailySessionUsageStatistics
object filtered by a list of record identifiers- Parameters:
dailyStats
- TheDailySessionUsageStatistics
from 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
Create an empty summary- Returns:
- an empty
StatisticsSummary
-
getTypes
Get the request counts sorted byRequestType
- Returns:
- a
Map
-
add
Create a new summary with the sum of request counts from this and another summary- Parameters:
other
- the otherSummaryStatistics
to add to this one- Returns:
- the sum of
SummaryStatistics
-
getTotalRequests
Get the total amount for requests for a givenRequestType
- Parameters:
types
- theRequestType
s to count- Returns:
- number of requests
-
getUniqueRequests
Get the number of unique request for a givenRequestType
- Parameters:
types
- theRequestType
s to count- Returns:
- number of unique requests
-
getLastRecordedDate
Get the last date for which requests have been recorded- Parameters:
types
- theRequestType
to check- Returns:
LocalDate
-
getAsCsv
-
calculateStartDate
-
calculateEndDate
-
isEmpty
public boolean isEmpty() -
setInformation
-
getInformation
-
isOlderThan
-
isOlderThan
-
getCreationTime
-