Skip to content

Commit

Permalink
Merge pull request #7965 from rebeccahhh/devel
Browse files Browse the repository at this point in the history
adding in inventory to unified job query for analytics

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] committed Sep 1, 2020
2 parents 8996d0a + 9a6f641 commit 1c55d10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion awx/main/analytics/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def query_info(since, collection_type):

# Copies Job Events from db to a .csv to be shipped
@table_version('events_table.csv', '1.1')
@table_version('unified_jobs_table.csv', '1.0')
@table_version('unified_jobs_table.csv', '1.1')
@table_version('unified_job_template_table.csv', '1.0')
@table_version('workflow_job_node_table.csv', '1.0')
@table_version('workflow_job_template_node_table.csv', '1.0')
Expand Down Expand Up @@ -272,6 +272,8 @@ def _copy_table(table, query, path):
django_content_type.model,
main_unifiedjob.organization_id,
main_organization.name as organization_name,
main_job.inventory_id,
main_inventory.name,
main_unifiedjob.created,
main_unifiedjob.name,
main_unifiedjob.unified_job_template_id,
Expand All @@ -289,6 +291,8 @@ def _copy_table(table, query, path):
main_unifiedjob.instance_group_id
FROM main_unifiedjob
JOIN django_content_type ON main_unifiedjob.polymorphic_ctype_id = django_content_type.id
LEFT JOIN main_job ON main_unifiedjob.id = main_job.unifiedjob_ptr_id
LEFT JOIN main_inventory ON main_job.inventory_id = main_inventory.id
LEFT JOIN main_organization ON main_organization.id = main_unifiedjob.organization_id
WHERE (main_unifiedjob.created > {0} OR main_unifiedjob.finished > {0})
AND main_unifiedjob.launch_type != 'sync'
Expand Down

0 comments on commit 1c55d10

Please sign in to comment.