docbrown/lib/tasks/metrics.rake
Michael Kohl 6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00

13 lines
408 B
Ruby

namespace :metrics do
desc "Collects metrics from Forem instances"
task overview: :environment do
puts "Admin Overview Link Tracking for #{Settings::General.app_domain}:"
links_by_target = Ahoy::Event.overview_link_clicks.group("properties -> 'target'").count
return unless links_by_target
links_by_target.each do |k, v|
puts "#{k.delete_prefix(URL.url)}: #{v}"
end
end
end