Commit 9e5ede6e authored by Alper Akgun's avatar Alper Akgun

Merge branch '288824-add-usage-ping-generation-to-a-rake-task-and-to-docs' into 'master'

Add usage ping generation to a rake task and to docs

See merge request gitlab-org/gitlab!48674
parents 12bcafff 04a1f67f
...@@ -1016,6 +1016,22 @@ This will also refresh the cached usage ping displayed in the admin area ...@@ -1016,6 +1016,22 @@ This will also refresh the cached usage ping displayed in the admin area
Gitlab::UsageData.to_json(force_refresh: true) 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 ## Elasticsearch
### Configuration attributes ### Configuration attributes
......
...@@ -9,5 +9,16 @@ namespace :gitlab do ...@@ -9,5 +9,16 @@ namespace :gitlab do
task dump_sql_in_json: :environment do task dump_sql_in_json: :environment do
puts Gitlab::Json.pretty_generate(Gitlab::UsageDataQueries.uncached_data) puts Gitlab::Json.pretty_generate(Gitlab::UsageDataQueries.uncached_data)
end 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
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