Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Excerpt

The statistics API provides summary information relating to the contents and usage of the repository and its resources.  This feature is currently under development.

RESTful API

Fedora provides an endpoint for users wishing to get some basic statistics for their repository, these are storage statistics and **not** usage metrics.

Currently this endpoint only provides the following three reports. Further report development will depend on community use cases.

RESTful API

...

Excerpt

High Level Stats Summary


Request URI: /fcr:stats

Methods: GET


Status
titleGET
Retrieve summary level repository statistics including:

  • total resource count, 
  • binary resource count,
  • total  binary resource bytes,
  • bytes ingested in last day, week, month, year
  • bytes retrieved in the last day week, month, year
  • binary resource count by mimetype
  • binary resource bytes by mimetype

Request Headers:

N/A

Request Parameters :

Example:

Code Block
curl http://localhost:8080/rest/fcr:stats

Response:

Code Block
{
  "resource_count": 2,
  "binaries": {
    "mime_types": [
      {
        "resource_count": 1,
        "byte_count": 31536,
        "mime_type": "application/pdf"
      }
    ],
    "resource_count": 1,
    "byte_count": 31536
  },
  "all_resources": {
    "rdf_types": [
      {
        "resource_count": 1,
        "byte_count": 31536,
        "resource_type": "http://fedora.info/definitions/v4/repository#Binary"
      },
      {
        "resource_count": 1,
        "byte_count": 0,
        "resource_type": "http://fedora.info/definitions/v4/repository#Container"
      },
      {
        "resource_count": 2,
        "byte_count": 31536,
        "resource_type": "http://fedora.info/definitions/v4/repository#Resource"
      },
      {
        "resource_count": 2,
        "byte_count": 31536,
        "resource_type": "http://mementoweb.org/ns#OriginalResource"
      },
      {
        "resource_count": 2,
        "byte_count": 31536,
        "resource_type": "http://mementoweb.org/ns#TimeGate"
      },
      {
        "resource_count": 1,
        "byte_count": 0,
        "resource_type": "http://www.w3.org/ns/ldp#BasicContainer"
      },
      {
        "resource_count": 1,
        "byte_count": 0,
        "resource_type": "http://www.w3.org/ns/ldp#Container"
      },
      {
        "resource_count": 1,
        "byte_count": 31536,
        "resource_type": "http://www.w3.org/ns/ldp#NonRDFSource"
      },
      {
        "resource_count": 1,
        "byte_count": 0,
        "resource_type": "http://www.w3.org/ns/ldp#RDFSource"
      },
      {
        "resource_count": 2,
        "byte_count": 31536,
        "resource_type": "http://www.w3.org/ns/ldp#Resource"
      }
    ]
  }
} 

Status:

Status
subtletrue
colourGreen
title200


Excerpt

High Level Stats Summary


Request URI: /fcr:stats/binaries

Methods: GET


Status
titleGET
Retrieve summary level repository statistics including:

Request Headers:

N/A

Request Parameters :

Example:

Code Block
curl http://localhost:8080/rest/fcr:stats/binaries

Response:

Code Block
{
  "mime_types": [
    {
      "resource_count": 1,
      "byte_count": 31536,
      "mime_type": "application/pdf"
    }
  ],
  "resource_count": 1,
  "byte_count": 31536
} 

Status:

Status
subtletrue
colourGreen
title200


Excerpt

High Level Stats Summary


Request URI: /fcr:stats/rdf-types

Methods: GET


Status
titleGET
Retrieve summary level repository statistics including:

Request Headers:

N/A

Request Parameters :

Example:

Code Block
curl http://localhost:8080/rest/fcr:stats/rdf-types

Response:

Code Block
{
  "rdf_types": [
    {

   "head": { 
           "total.resource.count": 1000,           "binary.resource.count": 500, 
           "binary.resource.bytes": 5023498342, 
           ...
    }

}
      "resource_count": 1,
      "byte_count": 31536,
      "resource_type": "http://fedora.info/definitions/v4/repository#Binary"
    },
    {
      "resource_count": 1,
      "byte_count": 0,
      "resource_type": "http://fedora.info/definitions/v4/repository#Container"
    },
    {
      "resource_count": 2,
      "byte_count": 31536,
      "resource_type": "http://fedora.info/definitions/v4/repository#Resource"
    },
    {
      "resource_count": 2,
      "byte_count": 31536,
      "resource_type": "http://mementoweb.org/ns#OriginalResource"
    },
    {
      "resource_count": 2,
      "byte_count": 31536,
      "resource_type": "http://mementoweb.org/ns#TimeGate"
    },
    {
      "resource_count": 1,
      "byte_count": 0,
      "resource_type": "http://www.w3.org/ns/ldp#BasicContainer"
    },
    {
      "resource_count": 1,
      "byte_count": 0,
      "resource_type": "http://www.w3.org/ns/ldp#Container"
    },
    {
      "resource_count": 1,
      "byte_count": 31536,
      "resource_type": "http://www.w3.org/ns/ldp#NonRDFSource"
    },
    {
      "resource_count": 1,
      "byte_count": 0,
      "resource_type": "http://www.w3.org/ns/ldp#RDFSource"
    },
    {
      "resource_count": 2,
      "byte_count": 31536,
      "resource_type": "http://www.w3.org/ns/ldp#Resource"
    }
  ]
}

Status:

Status
subtletrue
colourGreen
title200

...