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
Issue/2345 #2427
Issue/2345 #2427
Conversation
…nto issue/2345
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.
looks good @xsrust. It would be great at some point to go back into this stats code and clean up the models and services to make them more DRY.
Feel free to merge yourself once any requests from UAT are finished
@@ -9,7 +19,7 @@ class << self | |||
def call(org = nil) | |||
orgs = org.nil? ? Org.all : [org] | |||
|
|||
orgs.each do |org| | |||
Parallel.each(orgs, in_threads: 2) do |org| |
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.
this is great. I will use it in some of the ROR/API V1 upgrade tasks that take a long time to process
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.
might be able to switch to use ActiveJob once we move to Rails 5+
@@ -3,7 +3,7 @@ defaults: &defaults | |||
encoding: <%= ENV['DB_ADAPTER'] == "mysql2" ? "utf8mb4" : "" %> | |||
username: <%= ENV["DB_ADAPTER"] == "postgresql" ? 'postgres' : '' %> | |||
database: roadmap_<%= ENV['RAILS_ENV'] %> | |||
pool: 5 | |||
pool: 16 |
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.
Is this for the parallel gem?
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.
yeah, essentially each thread/process takes an additional db connection, so it was flooding the default 5. 16 is a bit overkill for development, but it means we don't end up with connection-timeout errors
"stat:create_last_month:shared_plan", | ||
"stat:create_last_month:exported_plan"] | ||
|
||
Parallel.each(tasks, progress: "Building Stats", in_processes: 4) do |task| |
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.
👍 this is great
looks like you have some failing stats tests too that need to be addressed |
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.
looks good @xsrust
Looks like the github-workflows are getting confused when checking things out from the DCC fork. |
Going to merge this so I can rebase the work on #1682 |
Addresses #2345
Overview of changes:
Download Global Usage
super-admin onlyDownload Monthly Usage
button to get a CSV of:Month, new plans, new users, downloads, plans shared
rake stat:build
andrake stat:build_last_month
create_
servicesNote:
UI with the multiple buttons looks funny at the moment, but I will refactor the layout in another feature's PR as I'd started this work there.