From 07341e7aa60fe7c7d4f298136af99276820940e7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 14 Oct 2021 20:44:59 +0200 Subject: Add graphs and retention metrics to admin dashboard (#16829) --- app/lib/admin/metrics/dimension.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/lib/admin/metrics/dimension.rb (limited to 'app/lib/admin/metrics/dimension.rb') diff --git a/app/lib/admin/metrics/dimension.rb b/app/lib/admin/metrics/dimension.rb new file mode 100644 index 000000000..279539f68 --- /dev/null +++ b/app/lib/admin/metrics/dimension.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class Admin::Metrics::Dimension + DIMENSIONS = { + languages: Admin::Metrics::Dimension::LanguagesDimension, + sources: Admin::Metrics::Dimension::SourcesDimension, + servers: Admin::Metrics::Dimension::ServersDimension, + space_usage: Admin::Metrics::Dimension::SpaceUsageDimension, + software_versions: Admin::Metrics::Dimension::SoftwareVersionsDimension, + }.freeze + + def self.retrieve(dimension_keys, start_at, end_at, limit) + Array(dimension_keys).map { |key| DIMENSIONS[key.to_sym]&.new(start_at, end_at, limit) }.compact + end +end -- cgit