2020-09-09 17:08:33 -04:00
|
|
|
namespace :gitlab do
|
|
|
|
namespace :usage_data do
|
|
|
|
desc 'GitLab | UsageData | Generate raw SQLs for usage ping in YAML'
|
|
|
|
task dump_sql_in_yaml: :environment do
|
|
|
|
puts Gitlab::UsageDataQueries.uncached_data.to_yaml
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'GitLab | UsageData | Generate raw SQLs for usage ping in JSON'
|
|
|
|
task dump_sql_in_json: :environment do
|
|
|
|
puts Gitlab::Json.pretty_generate(Gitlab::UsageDataQueries.uncached_data)
|
|
|
|
end
|
2020-12-03 10:09:46 -05:00
|
|
|
|
|
|
|
desc 'GitLab | UsageData | Generate usage ping in JSON'
|
|
|
|
task generate: :environment do
|
2020-12-07 10:09:49 -05:00
|
|
|
puts Gitlab::Json.pretty_generate(Gitlab::UsageData.uncached_data)
|
2020-12-03 10:09:46 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
desc 'GitLab | UsageData | Generate usage ping and send it to Versions Application'
|
|
|
|
task generate_and_send: :environment do
|
|
|
|
result = SubmitUsagePingService.new.execute
|
2020-12-07 10:09:49 -05:00
|
|
|
|
|
|
|
puts Gitlab::Json.pretty_generate(result.attributes)
|
2020-12-03 10:09:46 -05:00
|
|
|
end
|
2020-09-09 17:08:33 -04:00
|
|
|
end
|
|
|
|
end
|