• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ktdreyer / errata-tool / 98
38%

Build:
DEFAULT BRANCH: master
Ran 05 Jan 2017 07:58PM UTC
Jobs 1
Files 5
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
98

push

travis-ci

Lon Hohberger
Add errata call timings

When processing large numbers of errata from higher-level tools,
it's helpful to understand where the time is spent to see if multiple
calls can be avoided.

This patch adds a timings table to ErrataConnector.  Each
GET/PUT/POST is recorded, along with totals / mean / min / max.

URL APIs are deduplicated based on their name, so two calls to
different errata on the same API is recorded as a single API.

The timings only are recorded if ErrataConnector.debug is set
to True.

   { 'GET':
     { 'http://foo/***.json':
       { 'count': 10,         # number of calls to this API
         'total': 203.2,      # time spent in seconds
         'mean': 20.32,       # Average call time
         'min': 11.20,        # Fastest call
         'max': 31.3,         # Slowest call
       }
    },
    'POST': {
    ...
    },
    'PUT': {
    ...
    },
  }

To extract the information and print it, one might use PrettyTable:

    pt = PrettyTable()
    for c in ErrataConnector.timings:
        for u in ErrataConnector.timings[c]:
            pt.add_row([c, u,
                       ErrataConnector.timings[c][u]['count'],
                       ErrataConnector.timings[c][u]['total'],
                       ErrataConnector.timings[c][u]['mean'],
                       ErrataConnector.timings[c][u]['min'],
                       ErrataConnector.timings[c][u]['max']])
    print pt.get_string()

... or simply print them out.

Signed-off-by: Lon Hohberger <lhh@redhat.com>

80 of 705 relevant lines covered (11.35%)

0.11 hits per line

Jobs
ID Job ID Ran Files Coverage
1 98.1 05 Jan 2017 07:58PM UTC 0
11.35
Travis Job 98.1
Source Files on build 98
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #98
  • 43ac91c5 on github
  • Prev Build on master (#97)
  • Next Build on master (#99)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc