Bug 861409

Summary: Pulpv2 does not provide total size and rpm count on sync
Product: [Retired] Pulp Reporter: Justin Sherrill <jsherril>
Component: user-experienceAssignee: pulp-bugs
Status: CLOSED NOTABUG QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: low    
Version: MasterCC: cduryee, jason.dobies, jsherril, rbarlow, skarmark
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-07 21:41:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 854726    

Description Justin Sherrill 2012-09-28 13:52:14 UTC
Description of problem:

In pulpv1 each sync task status object would include the total size of the repo as well as the total package count.  

Pulpv2 does away with this and only includes the delta count and size. 

It would help katello greatly if either the total counts were added back, or existing counts were added such that we could combine existing + delta to get the new total.

Comment 1 Jay Dobies 2013-01-31 20:39:29 UTC
The total size of the repo is tricky. It's, oddly, due to the fact that the sync is more efficient in v2 since we know before starting the process what it is we need to download.

What I could see is a new API outside of any plugin that would iterate over all associated units and sum up the file sizes. Putting this off to 2.2 to give us time to investigate that possibility.

Comment 2 Jay Dobies 2013-04-01 17:29:04 UTC
Assigning to Mike to handle with the yum importer rewrite.

Comment 3 Michael Hrivnak 2013-09-04 18:03:56 UTC
Talking just now, Justin indicated that it is sufficient for them to have the ability to query for this data.

To get the size of each unit, a query can be done like this:

POST path: /pulp/api/v2/repositories/<repo id>/search/units/

POST data: {"criteria": {"fields": {"unit": ["name", "size"], "association": []}, "type_ids": ["rpm"], "filters": {"unit": {}}}}


You can of course just count the number of units you get back, or to get the counts of each unit type in a repo, do this query:

POST path: /pulp/api/v2/repositories/search/

POST data: {'criteria': {'fields': ['name', 'content_unit_counts']}}

Comment 4 Justin Sherrill 2013-09-04 18:10:48 UTC
Reopening for me to get some timings to see how performant this is with a larger number of repositories.

Comment 5 Chris Duryee 2014-11-07 21:41:31 UTC
closing BZ per jsherrill

Comment 6 Justin Sherrill 2017-02-06 13:35:33 UTC
Removing Needinfo

Comment 7 Justin Sherrill 2017-02-06 13:44:07 UTC
trying again