useful web console scripts - restarone/violet_rails GitHub Wiki
Web console cheatsheet
View total domain storage usage
number_to_human_size(Subdomain.all.pluck(:name).push('public').map{|name| Apartment::Tenant.switch(name) { ActiveStorage::Blob.all.pluck(:byte_size).sum } }.inject(0, :+))
View total visits
Subdomain.all.pluck(:name).map{|name| Apartment::Tenant.switch(name){ {name: name, visits: Ahoy::Visit.all.size} } }.map{|h| h[:visits]}.inject(0, :+)