Bug 1647454 - RFE to allow for better stats gathering
Summary: RFE to allow for better stats gathering
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Michal Domonkos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1676891 1737516
TreeView+ depends on / blocked
 
Reported: 2018-11-07 13:59 UTC by Jim Perrin
Modified: 2019-08-15 07:58 UTC (History)
11 users (show)

Fixed In Version: libdnf-0.35.3-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1676891 (view as bug list)
Environment:
Last Closed: 2019-08-15 07:58:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jim Perrin 2018-11-07 13:59:14 UTC
Description of problem:
Currently, very little in dnf allows for statistics to be gathered about which packages or modules as user has chosen to install. I'd like to request that an 'install' action in dnf pass this information to the server as part of the request for repository information. In this fashion, a url could be constructed that would gather package information.

A hypothetical example repository url for fedora could be:

metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch&pkg=$install


In this example, $install would be an array containing the names of packages the user requested to install. On update/non-install actions it would be empty and simply ignored in the server logs. 

This would provide fedora a way to show packagers a rough idea of how many times their package was being installed. 


Below is a mailing list request from the community for this type of information:

https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org/thread/BLUC224OHMHYAWPC3MWJLFUIJZR2COZT/

Comment 1 Daniel Mach 2019-02-13 14:10:49 UTC
Fedora Change: https://fedoraproject.org/wiki/Changes/DNF_Better_Counting


The change consists of 2 parts:
- User-Agent change
- countme feature


User-Agent
----------

Schemas:
libdnf/$libdnf_version ($NAME $VERSION_ID; Linux.$basearch)
libdnf/$libdnf_version ($NAME $VERSION_ID; $VARIANT_ID; Linux.$basearch)

Examples:
libdnf/0.26.0 (Fedora 29; Linux.x86_64)
libdnf/0.26.0 (Fedora 29; server; Linux.x86_64)
libdnf/0.26.0 (Red Hat Enterprise Linux 7.6; workstation; Linux.x86_64)


Countme
-------
Add a new 'countme' option to repo configs, for example:
[fedora]
countme = 1

Create a new dnf sub-command to trigger the countme feature:
$ dnf countme
Iterate through all repos:
if countme == 1:
   GET($url?countme=1)
   where $url is first available from [metalink, mirrorlist, baseurl]
   # consider using HEAD instead of GET

Create a systemd timer triggering the `dnf countme` command periodically

Comment 2 Michal Domonkos 2019-02-15 19:41:36 UTC
Note to (mostly) self on capturing the User-Agent field:

1) Create a local repo (id=myrepo) somewhere on the file system and host it with:
  $ python -m SimpleHTTPServer &
2) Create /etc/yum.repos.d/myrepo.repo
3) In one terminal, run:
  # tcpflow -p -c -i lo port 8000 | grep -i user-agent
4) In another terminal, run:
  # dnf --refresh --disablerepo=\* --enablerepo=myrepo makecache
5) Observe the User-Agent value in the first terminal

Comment 3 Michal Domonkos 2019-08-05 14:47:16 UTC
Upstream PR: https://github.com/rpm-software-management/libdnf/pull/768

Comment 4 Michal Domonkos 2019-08-05 14:51:41 UTC
I've also requests the addition "countme=1" to the fedora-repos package:
https://bugzilla.redhat.com/show_bug.cgi?id=1737516

Comment 5 Michal Domonkos 2019-08-05 15:00:08 UTC
*requested


Note You need to log in before you can comment on or make changes to this bug.