IQSS / dataverse-metrics

Aggregate and visualize metrics for installations of Dataverse around the world
https://dataverse.org/metrics
Apache License 2.0
8 stars 9 forks source link
hacktoberfest

dataverse-metrics

Introduction

dataverse-metrics aggregates metrics from Dataverse installations around the world and visualizes them on a web page. It makes use of the Dataverse Metrics API that was added in Dataverse 4.9.

If you are looking for visualizations for a single installation of Dataverse, please see https://github.com/gdcc/dv-metrics

Requirements

Installation

Put code into place

Change to the parent directory for where you will install dataverse-metrics. /var/www/html is the default "DocumentRoot" for Apache on CentOS (defined in /etc/httpd/conf/httpd.conf) and is suggested as a place to install dataverse-metrics, but you are welcome to install it wherever you want and use any server you want.

cd /var/www/html

Clone the repo:

git clone https://github.com/IQSS/dataverse-metrics.git

Change to the directory you just created by cloning the repo:

cd dataverse-metrics

Configuration

Copy config.json.sample to config.json and edit the following values:

Aggregating metrics

Now that your config.json file is ready, run the metrics.py script to create a TSV file for each of the endpoints and a contributors.json file for the github_repos, all of which will be placed in the aggregate_output_dir directory:

python3 metrics.py

(Please note that if you don't have Python 3 installed, Python 2 should work fine too but Python 3 is highly recommended because Python 2 will not be maintained past January 1, 2020 according to https://pythonclock.org and PEP 373.)

Viewing the visualizations

Using the instructions above, index.html has been placed at /var/www/html/dataverse-metrics/index.html and should be available on your Apache server at http://example.com/dataverse-metrics/index.html

Adding additional installations

The list of Dataverse installations depends on all-dataverse-installations.json which can be updated with the following script as new installations are added to the map produced by dataverse-installations:

./update-all-installations-list.sh

Updating Metrics

To update your metrics periodically, you'll want to queue up a shell script in some flavor of cron.

Here's an example shell script to get you started.

On a Red Hat or CentOS system, you might drop a file like update_metrics.cron into /etc/cron.d/ to update on a specified schedule.

Contributing

We love contributors! Please see our Contributing Guide for ways you can help and check out the to do list below.

To Do

Build Status