Bug 883798

Summary: RFE: connections counter from host to xmlprc
Product: [Fedora] Fedora Reporter: Petr Sklenar <psklenar>
Component: python-nitrateAssignee: Petr Šplíchal <psplicha>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: azelinka, jscotka, ohudlick, psplicha
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-07 18:53:15 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:

Description Petr Sklenar 2012-12-05 10:57:17 UTC
Description of problem:
I would like to have some counter of connections to nitrate.
how many attempts of connections/queries did some script ...


Steps to Reproduce:
1. DEBUG=1 python scripts-using-python-nitrate.py

  
Actual results:
none

Expected results:
<number> connections to xmlrpc.<fqdn_of_nitrate>

Additional info:
to have lower db usage of nitrate

Comment 1 Petr Šplíchal 2012-12-05 11:14:13 UTC
This feature is already implemented:

$ nitrate
>>> print Nitrate()
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 0
>>> case = TestCase(1234)
>>> print case
TC#1234   - Thunderbird: Writing new mail
>>> print Nitrate()
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 1
>>> print case
TC#1234   - Thunderbird: Writing new mail
>>> print Nitrate()
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 1
>>> case = TestCase(2345)
>>> print case
TC#2345   - Thunderbird: Reading mail
>>> print Nitrate()
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 2

You can access the attribute from any Nitrate object, for example:

    Nitrate._requests
    case._requests

However, I see this is not documented anywhere. I will keep the
bug open to fix this. Do you think a public (without underscore)
attribute "requests" would be a good solution here?

Comment 2 Petr Sklenar 2012-12-05 11:42:03 UTC
I see, I tried and it works.
I thing it can be unchanged (_requests). As its for debugging only

Comment 6 Petr Šplíchal 2012-12-06 09:33:22 UTC
Documented how to get a short Nitrate summary:
https://github.com/psss/python-nitrate/commit/e8093c6

Comment 7 Fedora Update System 2012-12-10 12:42:34 UTC
python-nitrate-0.9-0.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.el6

Comment 8 Fedora Update System 2012-12-10 12:49:25 UTC
python-nitrate-0.9-0.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc18

Comment 9 Fedora Update System 2012-12-10 12:49:26 UTC
python-nitrate-0.9-0.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc16

Comment 10 Fedora Update System 2012-12-10 12:49:28 UTC
python-nitrate-0.9-0.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc17

Comment 11 Fedora Update System 2012-12-11 07:47:55 UTC
python-nitrate-0.9-0.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-13721/python-nitrate-0.9-0.el6

Comment 12 Fedora Update System 2012-12-19 08:33:31 UTC
python-nitrate-0.9-0.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2012-12-19 08:43:58 UTC
python-nitrate-0.9-0.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2013-01-07 18:53:17 UTC
python-nitrate-0.9-0.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2013-01-12 01:10:32 UTC
python-nitrate-0.9-0.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.