{"id":25257278,"url":"https://github.com/zowe/project-metrics","last_synced_at":"2025-07-26T13:40:26.668Z","repository":{"id":39569279,"uuid":"390037425","full_name":"zowe/project-metrics","owner":"zowe","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-24T16:58:31.000Z","size":11572,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T19:46:54.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zowe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-27T15:37:39.000Z","updated_at":"2023-03-14T07:37:20.000Z","dependencies_parsed_at":"2022-08-29T10:50:47.913Z","dependency_job_id":null,"html_url":"https://github.com/zowe/project-metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zowe/project-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fproject-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fproject-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fproject-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fproject-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zowe","download_url":"https://codeload.github.com/zowe/project-metrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fproject-metrics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262049337,"owners_count":23250729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-12T06:38:43.580Z","updated_at":"2025-06-26T10:36:02.405Z","avatar_url":"https://github.com/zowe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project-metrics\n\n### Contents\n - [Requirements](#requirements)\n - [Getting Started](#getting-started)\n    - [Clone the repository](#clone-the-repository)\n    - [The repository structure](#the-repository-struct)\n    - [Running the containers](running-the-containers)\n    - [Missing Data](#missing-data)\n    - [Error logs](#error-logs)\n    - [Report Generation](#report-generation)\n    - [Volumes](#volumes)\n - [Backup and Restore](#backup-and-restore)\n    - [Backup](#backup)\n    - [Restore dumped data](#restore-dumped-data)\n - [License](LICENSE)\n\n### Requirements\n- `api.env` file\n- `client.env` file\n- `db.env` file\n\nThese 3 files must be filled with the detail provided by the template to their corresponding .env.example files.\n\n- `metricsAnalyticsData.json` file\n\nContains the JSON for accessing the Google analytics api.\n\n## Getting Started\n### Clone the repository\n```\ngit clone https://github.com/zowe/project-metrics.git\n```\n### The repository structure\n- `├──`[`zowe-metrics-api`](./zowe-metrics-api) — contains source code for the server-side.\u003cbr\u003e\n  \u003c!-- - `├──`[`eslint-plugin-zowe-explorer`](./packages/eslint-plugin-zowe-explorer) — includes necessary files to configure ESLint plug-in for Zowe Explorer\n  - `├──`[`zowe-explorer-api`](./packages/zowe-e) --\u003e\n- `├──`[`zowe-metrics-client`](./zowe-metrics-client) — contains source code for the client-side.\u003cbr\u003e\n\n\n### Running the containers\nMove into the `project-metrics` directory\n\n```\ncd project-metrics\n```\nThen run\n\n```\ndocker-compose up -d --build\n```\nThis builds and runs 3 docker containers:\n- The database (metrics-db)\n- API (metrics-api)\n- Client (metrics-client)\n\nThen navigate to the client `PORT` specified in the `client.env` file e.g. `http://localhost:3001/` to see the locally hosted metric site.\n\n### Missing data\nOn start-up, you may find that the graphs and data have not been restored. To dump and restore the backed-up data, refer to [Backup and Restore](#Backup-and-Restore).\n\n### Error logs\nTo monitor the error logs for each of the three containers, run\n\n```\ndocker logs [CONTAINER]\n```\nwhere CONTAINER is one of `metrics-db`, `metrics-api` or `metrics-client`.\n\nMore documentation can be found [here](https://docs.docker.com/engine/reference/commandline/logs/).\n\n### Report Generation\nReports are periodically generated at 00:01:00 every month, which is defined in [app.js](./zowe-metrics-api/app.js).\n\n### Volumes\nRunning these containers will create 2 local directories at the root of the project:\n\n- `data` - Persistent data storage for the MongoDB. If the containers are deleted and recreated, the data will not be lost.\n- `PDFStore` - Contains the PDF reports generated each month by the API container. If the containers are deleted and recreated, the PDFs are not lost.\n\nOptional:\n\n- `dumps` - See Backup section below - contains data dumps of the database for restoration purposes if the data directory is also lost.\n\n## Backup and Restore\n### Backup\nTo backup the data to the directory `dump/{Date}` (eg - /dump/24-06-2021), execute the command:\n\n\n```\ndocker exec -it {DB_CONTAINER_NAME} mongodump -d {DATABASE_NAME} -o /dump/$(date +'%d-%m-%Y') -u {DATABASE_USERNAME} -p {DATABASE_PASSWORD} --authenticationDatabase {DATABASE_AUTH_DATABASE}\n```\n\n#### Command Options\n`-d` - Name of the database inside the database container. (eg - container called metrics-db containing a database called ZoweMetricsDB).\n\n`-o` - Output directory of the data dump. This directory will container a new directory called the same name as the database, containing files used to backup the data.\n\n`-u` - Username for the database, specififed initially in the db.env file.\n\n`-p` - Password for the database, specififed initially in the db.env file.\n\n`--authenticationDatabase` - Database used to authenticate the user - Default is admin.\n\n### Restore dumped data\nRestore dumped/backed-up data by executing the command:\n\n```\ndocker exec -it {DB_CONTAINER_NAME} mongorestore {DIR_OF_DUMP} -u {DATABASE_USERNAME} -p {DATABASE_PASSWORD} --authenticationDatabase {DATABASE_AUTH_DATABASE}\n```\n\n#### Command Options\n`-d` - Name of the database inside the database container. (eg - container called `metrics-db` containing a database called ZoweMetricsDB).\n\n`DIR_OF_DUMP` - Directory specified in the backup command (eg - `dump/24-06-2021`).\n\n`-u` - Username for the database, specififed initially in the `db.env` file.\n\n`-p` - Password for the database, specififed initially in the `db.env` file.\n\n`--authenticationDatabase` - Database used to authenticate the user - Default is admin.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzowe%2Fproject-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzowe%2Fproject-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzowe%2Fproject-metrics/lists"}