Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Created April 23, 2019 16:49
Show Gist options
  • Select an option

  • Save dLobatog/0578f5bacc66f869a871757309a9a763 to your computer and use it in GitHub Desktop.

Select an option

Save dLobatog/0578f5bacc66f869a871757309a9a763 to your computer and use it in GitHub Desktop.
Started POST "/api/compliance/graphql" for 127.0.0.1 at 2019-04-23 18:49:32 +0200
Processing by GraphqlController#query as */*
Parameters: {"operationName"=>nil, "variables"=>{}, "query"=>"{\n allProfiles {\n id\n name\n ref_id\n description\n total_host_count\n compliant_host_count\n __typename\n }\n}\n", "graphql"=>{"operationName"=>nil, "variables"=>{}, "query"=>"{\n allProfiles {\n id\n name\n ref_id\n description\n total_host_count\n compliant_host_count\n __typename\n }\n}\n"}}
User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."username" = $1 LIMIT $2 [["username", "dlobatog@redhat.com"], ["LIMIT", 1]]
↳ app/controllers/graphql_controller.rb:9
Profile Load (1.6ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."account_id" = $1 [["account_id", "9f6f30ee-dd69-42e6-bfc0-374e85e3cdc7"]]
↳ app/controllers/graphql_controller.rb:10
ProfileHost Load (1.8ms) SELECT "profile_hosts".* FROM "profile_hosts" WHERE "profile_hosts"."profile_id" IN ($1, $2, $3, $4) [["profile_id", "4bfa5d57-10b8-433d-892c-9033e38356fc"], ["profile_id", "562ba49d-8cc4-4078-a87f-44441e8537de"], ["profile_id", "39dd4e4e-9dd6-4327-82f8-36e514e79a3c"], ["profile_id", "e0c64a9b-003e-4c66-b87d-50059ebcf673"]]
↳ app/controllers/graphql_controller.rb:10
Host Load (0.9ms) SELECT "hosts".* FROM "hosts" WHERE "hosts"."id" IN ($1, $2, $3, $4) [["id", "f5cf6f1c-fccf-4f41-8001-f12434cb0943"], ["id", "6b97bc3a-3614-411f-9a9d-4a8a5b041687"], ["id", "bb49ab88-e26c-4838-aca8-69edab18973c"], ["id", "98414501-aa18-4deb-985b-820d39fe7a63"]]
↳ app/controllers/graphql_controller.rb:10
(1.0ms) SELECT COUNT(*) FROM "hosts" INNER JOIN "profile_hosts" ON "hosts"."id" = "profile_hosts"."host_id" WHERE "profile_hosts"."profile_id" = $1 [["profile_id", "4bfa5d57-10b8-433d-892c-9033e38356fc"]]
↳ app/models/schema.rb:38
RuleResult Load (29.8ms) SELECT rule_results.* FROM (
SELECT rr2.*,
rank() OVER (
PARTITION BY rule_id, host_id
ORDER BY created_at DESC
)
FROM rule_results rr2
WHERE rr2.host_id = 'bb49ab88-e26c-4838-aca8-69edab18973c' AND rr2.rule_id IN
(SELECT rules.id FROM rules
INNER JOIN profile_rules
ON rules.id = profile_rules.rule_id
WHERE profile_rules.profile_id = '4bfa5d57-10b8-433d-892c-9033e38356fc')
) rule_results WHERE RANK = 1
↳ app/models/profile.rb:38
(4.0ms) SELECT COUNT(*) FROM "hosts" INNER JOIN "profile_hosts" ON "hosts"."id" = "profile_hosts"."host_id" WHERE "profile_hosts"."profile_id" = $1 [["profile_id", "562ba49d-8cc4-4078-a87f-44441e8537de"]]
↳ app/models/schema.rb:38
RuleResult Load (22.0ms) SELECT rule_results.* FROM (
SELECT rr2.*,
rank() OVER (
PARTITION BY rule_id, host_id
ORDER BY created_at DESC
)
FROM rule_results rr2
WHERE rr2.host_id = 'bb49ab88-e26c-4838-aca8-69edab18973c' AND rr2.rule_id IN
(SELECT rules.id FROM rules
INNER JOIN profile_rules
ON rules.id = profile_rules.rule_id
WHERE profile_rules.profile_id = '562ba49d-8cc4-4078-a87f-44441e8537de')
) rule_results WHERE RANK = 1
↳ app/models/profile.rb:38
(0.9ms) SELECT COUNT(*) FROM "hosts" INNER JOIN "profile_hosts" ON "hosts"."id" = "profile_hosts"."host_id" WHERE "profile_hosts"."profile_id" = $1 [["profile_id", "39dd4e4e-9dd6-4327-82f8-36e514e79a3c"]]
↳ app/models/schema.rb:38
RuleResult Load (22.5ms) SELECT rule_results.* FROM (
SELECT rr2.*,
rank() OVER (
PARTITION BY rule_id, host_id
ORDER BY created_at DESC
)
FROM rule_results rr2
WHERE rr2.host_id = '98414501-aa18-4deb-985b-820d39fe7a63' AND rr2.rule_id IN
(SELECT rules.id FROM rules
INNER JOIN profile_rules
ON rules.id = profile_rules.rule_id
WHERE profile_rules.profile_id = '39dd4e4e-9dd6-4327-82f8-36e514e79a3c')
) rule_results WHERE RANK = 1
↳ app/models/profile.rb:38
(1.8ms) SELECT COUNT(*) FROM "hosts" INNER JOIN "profile_hosts" ON "hosts"."id" = "profile_hosts"."host_id" WHERE "profile_hosts"."profile_id" = $1 [["profile_id", "e0c64a9b-003e-4c66-b87d-50059ebcf673"]]
↳ app/models/schema.rb:38
RuleResult Load (8.6ms) SELECT rule_results.* FROM (
SELECT rr2.*,
rank() OVER (
PARTITION BY rule_id, host_id
ORDER BY created_at DESC
)
FROM rule_results rr2
WHERE rr2.host_id = 'f5cf6f1c-fccf-4f41-8001-f12434cb0943' AND rr2.rule_id IN
(SELECT rules.id FROM rules
INNER JOIN profile_rules
ON rules.id = profile_rules.rule_id
WHERE profile_rules.profile_id = 'e0c64a9b-003e-4c66-b87d-50059ebcf673')
) rule_results WHERE RANK = 1
↳ app/models/profile.rb:38
RuleResult Load (1131.2ms) SELECT rule_results.* FROM (
SELECT rr2.*,
rank() OVER (
PARTITION BY rule_id, host_id
ORDER BY created_at DESC
)
FROM rule_results rr2
WHERE rr2.host_id = '6b97bc3a-3614-411f-9a9d-4a8a5b041687' AND rr2.rule_id IN
(SELECT rules.id FROM rules
INNER JOIN profile_rules
ON rules.id = profile_rules.rule_id
WHERE profile_rules.profile_id = 'e0c64a9b-003e-4c66-b87d-50059ebcf673')
) rule_results WHERE RANK = 1
↳ app/models/profile.rb:38
Completed 200 OK in 2183ms (Views: 0.5ms | ActiveRecord: 1274.7ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment