Skip to content

Enable date-based usage statistics from the DSpace Statistics API #56

@alanorth

Description

@alanorth

View and download statistics are currently "all time" due to limitations of the DSpace Statistics API. We should explore the possibility of enabling a "reporting period". The current version of the API supports date ranges so we can now limit statistics to a date range by POSTing community, collection, or item IDs and date parameters.

For example, if you send this request:

{
    "limit": 100,
    "page": 0,
    "dateFrom": "2020-01-01T00:00:00Z",
    "dateTo": "2020-11-18T00:00:00Z",
    "items": [
        "926ffacd-1916-4366-a420-a966c195295f",
        "e8c64069-78ba-4472-b5b2-72d705f04ca7",
        "e9ac05b8-3270-4e2f-83fb-45e3c65e0c9c",
        "326c00a4-977e-4d32-968a-c372b18bf8c0"
    ]
}

The API will respond:

{
   "currentPage" : 0,
   "limit" : 100,
   "statistics" : [
      {
         "downloads" : 0,
         "id" : "e9ac05b8-3270-4e2f-83fb-45e3c65e0c9c",
         "views" : 420
      },
      {
         "downloads" : 0,
         "id" : "e8c64069-78ba-4472-b5b2-72d705f04ca7",
         "views" : 37
      },
      {
         "downloads" : 0,
         "id" : "326c00a4-977e-4d32-968a-c372b18bf8c0",
         "views" : 10
      },
      {
         "downloads" : 9,
         "id" : "926ffacd-1916-4366-a420-a966c195295f",
         "views" : 4
      }
   ],
   "totalPages" : 0
}

The problem is that this is only feasible for hundreds or thousands of items, but not the entire repository. We could enable it as an option when generating a report perhaps, rather than for the entire AReS Explorer UI. See the Swagger API docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions