In statistics.xml file it is possible to configure one or many generators to be used to extract statistics data for a given DSpace object or objects associated to it by mean of DSpace-CRIS inverse relations mechanism.

Currently available generators, all implementations of org.dspace.app.rest.statistics.UsageReportGenerator, are:

Java Class

Extracted Data

org.dspace.app.rest.statistics.TopCitiesGenerator

List of cities from where DSpace Object, or its related Objects, visits are coming, sorted by number of visits in decreasing order

org.dspace.app.rest.statistics.TopCountriesGenerator

List of countries from where DSpace Object, or its related Objects, visits are coming, sorted by number of visits in decreasing order

org.dspace.app.rest.statistics.TopItemsGenerator

Usage report of the items most popular over the entire site or a specific community, collection

org.dspace.app.rest.statistics.TotalDownloadsAndVisitsGenerator

Number of times a DSpace Object, or its related Objects, have been visited and its attachments have been downloaded

org.dspace.app.rest.statistics.TotalDownloadsGenerator

Number of times a DSpace Object, or its related Objects, attachments have been downloaded

org.dspace.app.rest.statistics.TotalVisitGenerator

Number of times a DSpace Object, or its related Objects, attachments have been visited

org.dspace.app.rest.statistics.TotalVisitPerPeriodGenerator

Number of times a DSpace Object, or its related Objects, attachments have been visited in a period of time, grouped by a period duration (month by month, year by year, etc.)

For each generator, following properties are provided:

For org.dspace.app.rest.statistics.TotalVisitPerPeriodGenerator implementation, “periodType” and “increment” fields are provided and will be used by solr query responsible of extracting period related statistics. “periodType” specifies period granularity (“year”, “month” or “day”), “increment” is used to define period steps, for example, an increment of 1 for a “month” periodType will extract visits grouped 1 month per time. This configuration

<bean id="totalVisitPerPeriodGenerator" class="org.dspace.app.rest.statistics.TotalVisitPerPeriodGenerator">
        <property name="viewMode" value="chart.line"/>
        <property name="maxResults" value="6"/>
        <property name="periodType" value="month"/>
        <property name="increment" value="1"/>
</bean>

extracts item visits of last 6 months, grouped by single month.

An simple generator, which extracts usage data for item received in input is configured in this way:

<bean id="totalVisitGenerator" class="org.dspace.app.rest.statistics.TotalVisitGenerator">
        <property name="viewMode" value="table"/>
</bean>

while this other generator will extract data related to objects related to item received in input by mean of inverse relation “RELATION.Person.researchoutputs“ defined in discovery.xml file:

<bean id="totalVisitGeneratorRelationPersonResearchoutputs" class="org.dspace.app.rest.statistics.TotalVisitGenerator">
        <property name="viewMode" value="table"/>
        <property name="relation" value="RELATION.Person.researchoutputs"/>
</bean>

statistics.xml file entry point to define generators mapping is the bean of type org.dspace.app.rest.statistics.StatisticsReportsConfiguration. Its “mapping” property contains a map between DSpaceObject instance types and a list of org.dspace.app.rest.model.UsageReportCategoryRest instances. For each of those instances, following properties are set:

DSpaceObject instance types defined as “key” in “mapping” map could be:


REST contracts to obtain statistics data are defined at https://github.com/4Science/Rest7Contract/blob/main-cris/statistics-reports.md and https://github.com/4Science/Rest7Contract/blob/main-cris/statistics-categories.md

On DSpace-CRIS, statistics are available to logged users at link

http(s)://<dspace-cris-base-url>/statistics/items/<dspace-object-id>

Usage statistics on database

By means of “store-metrics” process, which can be triggered via processes UI section or CLI, it is possible to generate view and download usage statistics for each item part of DSpace-CRIS repository, and have them stored as Item’s metric in cris_metrics table. In this way, view and download data can be made available within a DSpace-CRIS Item metrics box.