Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Changes to load_mongodump.sh and Sync with em-public-dashboard #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TeachMeTW
Copy link
Contributor

@TeachMeTW TeachMeTW commented Jan 6, 2025

Description

Restores the changes made to the docker/load_mongodump.sh file that seem to have been overwritten during a rebase.

Additionally, this PR incorporates the necessary changes from e-mission/em-public-dashboard#163, ensuring consistency across repositories and minimizing the need for manual edits in the future.

Changes

Related Issues

Testing

  • Verified the restored script functionality locally.

Example

Loaded a script via ./load_mongodump.sh <file>, for example:
./load_mongodump.sh ~/Downloads/openpath_prod_stm_commute.tar.gz

The script loaded properly with no errors and displayed:
Database restore complete.

The docker-compose file was also updated.
image

@shankari
Copy link
Contributor

Verified the restored script functionality locally.

Please add details of the testing done.

shankari and others added 2 commits January 9, 2025 19:33
**Overview**

Enhances the user profile data retrieval process by incorporating newly
stored statistics (`pipeline_range`, `total_trips`, `labeled_trips`, and
`last_call`) into the existing `with` block. These statistics are now
seamlessly integrated into the `user` dictionary, providing a more
comprehensive set of user metrics for further analysis and dashboard
visualization.

1. **Enhanced Profile Data Retrieval**

- **Existing Functionality**:
  - The `with` block previously retrieved basic profile information such as `platform`, `manufacturer`, `app_version`, `os_version`, and `phone_lang` from the database and assigned them to the `user` dictionary.

- **New Enhancements**:
  - **Pipeline Range**:
    - Retrieved `pipeline_range` data, including `start_ts` and `end_ts`, to understand the timeframe of the user's activity pipeline.
  - **Trip Counts**:
    - Extracted `total_trips` and `labeled_trips` to provide insights into the user's trip data and the extent of trip labeling.
  - **Last API Call Timestamp**:
    - Obtained `last_call` to track the most recent API interaction by the user.
  - **Optional Formatting**:
    - Included a formatted version of the `last_call` timestamp for better readability in reports and dashboards.

2. **Updated `with` Block Structure**

- **Integration of New Statistics**:
  - The `with` block now not only fetches and assigns basic profile attributes but also retrieves and assigns the newly stored statistics from the database.

Additional commits squashed into this:
- Accidentally removed the process loop
- Simplified else block for user data
- Merge
- Addressed comment, modified else if block
- Updated COLS to be uniform like the other constants. Updated ADD USER STATS
…ose.dev.yml from EM-Dash; Restore previous load_mongodump script that was purged from commit cleaning
@TeachMeTW
Copy link
Contributor Author

@shankari Addressed and added testing procedure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review done; Changes requested
Development

Successfully merging this pull request may close these issues.

2 participants