Skip to content

Commit

Permalink
modifciation: documentation for statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Gualdi committed Apr 26, 2024
1 parent baeac21 commit 6fc1269
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (C) 2021 Graz University of Technology.
Copyright (C) 2021-2024 Graz University of Technology.
Invenio-Records-Marc21 is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -35,20 +35,48 @@ Install
Choose a version of elasticsearch and a DB, then run:

.. code-block:: console
pipenv run pip install -e .[all]
pipenv run pip install invenio-search[elasticsearch7]
pipenv run pip install invenio-db[postgresql,versioning]
Service
=========
Setting Up Statistics
=====================

To enable and configure the statistics feature using MARC21 records in Invenio, you need to update your `invenio.cfg` file with specific configurations that integrate MARC21 statistics with Invenio's standard statistics modules.

### Configuration Steps

1. **Import Required Configurations:**

Before updating the configuration values, ensure that you import the necessary settings from both the `invenio_records_marc21` module and the `invenio_app_rdm` module. Add the following lines to your `invenio.cfg`:

.. code-block:: console
from invenio_records_marc21.config import MARC21_STATS_CELERY_TASKS, MARC21_STATS_EVENTS, MARC21_STATS_AGGREGATIONS, MARC21_STATS_QUERIES
from invenio_app_rdm.config import CELERY_BEAT_SCHEDULE, STATS_EVENTS, STATS_AGGREGATIONS, STATS_QUERIES
Update Celery Beat Schedule:

Integrate MARC21-specific scheduled tasks with Invenio's scheduler:

.. code-block:: console
CELERY_BEAT_SCHEDULE.update(MARC21_STATS_CELERY_TASKS)
Update Events, Aggregations, and Queries:

Merge MARC21 statistics configurations with the global statistics settings:

.. code-block:: console
STATS_EVENTS.update(MARC21_STATS_EVENTS)
STATS_AGGREGATIONS.update(MARC21_STATS_AGGREGATIONS)
STATS_QUERIES.update(MARC21_STATS_QUERIES)
** Create Marc21 Record**
Tests
=========

.. code-block:: console
pipenv run ./run-tests.sh
pipenv run ./run-tests.sh

0 comments on commit 6fc1269

Please sign in to comment.