-
Notifications
You must be signed in to change notification settings - Fork 120
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
Inactive users script #1019
Inactive users script #1019
Conversation
This needs to be restored. I am not going to sit and edit the |
Also, how did you test this? Can you please update "Testing done"? |
I misunderstood the _common.py file and I didn't realize you could pass in the arguments of the function to execute with the |
Testing was done with the private database dump "openpath-stage-snapshot-investigate-demographics". Since this dump is over a year old, running the script with a threshold of one day marks all the users as inactive
Setting the threshold to 500 days gives us some active users
Let's remove these users
Now there are no more inactive users with a threshold of 500 days
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we need to make the changes to read from the profile anyway, I think it would also be helpful to have the script output the results as a csv, one line per deployment. That would allow us to save the results and generate some pretty pictures as needed later.
@@ -26,17 +26,21 @@ | |||
] | |||
print(f"PROD_LIST: {PROD_LIST}") | |||
|
|||
def run_on_all_deployments(fn_to_run): | |||
def run_on_all_deployments(fn_to_run, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! @JGreenlee for visibility
@catarial I am merging this right now, but could you submit a separate PR that generates a csv of the results for better downstream analysis and tracking? |
Extension of #1010
A command line python script that identifies and optionally removes inactive users.
The amount of time that defines an active user can be specified with the
-t
flag.The threshold time is compared to the timestamps of API calls and locations in the database.
I decided to pull out the part where it get's run on all deployments in favor of more configurability.