Monitor usage ping on 13.2

This is a followup for #217706 (closed)

Transferred issues

Fix and check new usage counters which time out

  1. @ali-gitlab counts.issues_with_health_status #223709 (closed)
  2. @alinamihaila usage_activity_by_stage.user_container_scanning_jobs #223711 (closed)
  3. @aakgun usage_activity_by_stage.ci_builds #223713 (closed)
  4. @a_akgun "usage_activity_by_stage.ci_pipeline_config_auto_devops" & "usage_activity_by_stage.ci_pipeline_config_repository": #223714 (closed)

New counters

  1. Add personal and project snippet monthly counters to usage data !35155 (merged)

How to test

  1. Future in versions app console RawUsageData.find(uuid: '')
  2. on gprd rails console
Time.now
[Time.now, aapayload = Gitlab::UsageData.to_json(force_refresh: true), Time.now]
puts aapayload

start: 2020-07-06 07:06:02 +0000
finish: 2020-07-07 07:04:06 +0000

It took 24 hours!!!

## Post to versions app
aares = Gitlab::HTTP.post( 'https://version.gitlab.com/usage_data', body: aapayload, allow_local_requests: true, headers: { 'Content-type' => 'application/json' })

usage_data_id: 21635202

/bin/herokuish procfile exec rails console

puts UsageData.select(:recorded_at, :app_server_type).where(hostname: 'gitlab.com', uuid: 'ea8bf810-1d6f-4a6a-b4fd-93e8cbd8b57f').order('id desc').limit(5).to_json

puts UsageData.find(21635202).raw_usage_data.payload.to_json


 

Edited by Alper Akgun