Skip to content

Use json pretty_generate in usage data rake tasks

What does this MR do?

Use Gitlab::Json.pretty_generate for printing usage take rake tasks, makes the output readable.

Rake tasks added with !48674 (merged)

Rake task output

rake gitlab:usage_data:generate
{
  "recorded_at": "2020-12-03 14:57:35 UTC",
  "uuid": "b4002b0e-666a-43ba-9422",
  "hostname": "127.0.0.1",
  "version": "13.7.0-pre",
  "installation_type": "gitlab-development-kit",
  "active_user_count": 81,
  "edition": "EEU",
  "license_md5": "106a4b25eca48a02bc6f30031a7cde05",
  "license_id": 32,
  "historical_max_users": 56,
  "licensee": {
    "Name": "Test",
    "Email": "Test@tasdfasdfasdfasdf.com",
    "Company": "Test"
  },
  "licen
...
rake gitlab:usage_data:generate_and_send
{
  "id": 16,
  "leader_issues": 3.31,
  "instance_issues": 0.0,
  "leader_notes": 19.03,
  "instance_notes": 0.0,
  "leader_milestones": 0.5,
  "instance_milestones": 0.0,
  "leader_boards": 0.33,
  "instance_boards": 0.0,
  "leader_merge_requests": 3.77,
  "instance_merge_requests": 0.0,
  "leader_ci_pipelines": 17.84,
  "instance_ci_pipelines": 0.0,
  "leader_environments": 0.83,
  "instance_environments": 0.0,
  "leader_deployments": 10.24,
  "instance_deployments": 0.0,
  "leader_projects_prometheus_active": 0.12,
  "instance_projects_prometheus_active": 0.0,
  "leader_service_desk_issues": 3.3,
  "instance_service_desk_issues": 0.0,
  "created_at": "2020-12-03 15:00:49 UTC",
  "updated_at": "2020-12-03 15:00:49 UTC",
  "percentage_boards": 0.0,
  "percentage_ci_pipelines": 0.0,
  "percentage_deployments": 0.0,
  "percentage_environments": 0.0,
  "percentage_issues": 0.0,
  "percentage_merge_requests": 0.0,
  "percentage_milestones": 0.0,
  "percentage_notes": 0.0,
  "percentage_projects_prometheus_active": 0.0,
  "percentage_service_desk_issues": 0.0
}

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Alina Mihaila

Merge request reports

Loading