Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-2236

Expose collection download count in the api

      Problem Description: We are counting downloads in installations, but not displaying the results in the api or UI.

      Proposed Solution:

      We want the download count so it can be displayed in the collection detail page in the UI. To mimic how it has been done (i.e. legacy galaxy.ansible.com), the count displayed would sum the downloads for all CollectionVersions in a Collection.

      Collection detail UI page pulls from /api/automation-hub/pulp/api/v3/content/ansible/collection_versions/ with url params for namespace name and version, which is coming from pulp_ansible.app.viewsets.CollectionVersionViewSet

      For the serializer accessing this data, we should assume the collection download log table is populated with 1M+ records, and that a query will need to aggregate many records across many CollectionVersions in the same Collection. Similar queries across access logs take a very long time. If the impact of this is too large, the use of redis cache should be investigated, where the seralizer uses the cache, and a separate worker process (perhaps run nightly) updates the cache from the collection download log table.

              bmclaugh@redhat.com Brian McLaughlin
              awcrosby5 Andrew Crosby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: