Commit 04a1f67f authored by Alina Mihaila's avatar Alina Mihaila Committed by Alper Akgun

Add rake task for usage ping generation

  - Add rake task to generate and print usage ping
  JSON
  - Add rake task to generate and send usage ping
  to Versions Application
  - Add docs
parent bd145786
......@@ -1016,6 +1016,22 @@ This will also refresh the cached usage ping displayed in the admin area
Gitlab::UsageData.to_json(force_refresh: true)
```
#### Generate and print
Generates usage ping data in JSON format.
```shell
rake gitlab:usage_data:generate
```
#### Generate and send usage ping
Prints the metrics saved in `conversational_development_index_metrics`.
```shell
rake gitlab:usage_data:generate_and_send
```
## Elasticsearch
### Configuration attributes
......
......@@ -9,5 +9,16 @@ namespace :gitlab do
task dump_sql_in_json: :environment do
puts Gitlab::Json.pretty_generate(Gitlab::UsageDataQueries.uncached_data)
end
desc 'GitLab | UsageData | Generate usage ping in JSON'
task generate: :environment do
puts Gitlab::UsageData.to_json(force_refresh: true)
end
desc 'GitLab | UsageData | Generate usage ping and send it to Versions Application'
task generate_and_send: :environment do
result = SubmitUsagePingService.new.execute
puts result.inspect
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment