~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to perf_graphing.py

  • Committer: Christopher Lee
  • Date: 2016-10-26 04:29:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1698.
  • Revision ID: chris.lee@canonical.com-20161026042927-j3wf3tt7pjpr1ok6
Add handling of HA perfscale reporting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    """Indicate when an expected metrics data file does not exist."""
63
63
 
64
64
 
 
65
class NoDataPresent(Exception):
 
66
    """Indicate when an no data is found in a metrics log file."""
 
67
 
 
68
 
65
69
def value_to_bytes(amount):
66
70
    """Using SI Prefix rules."""
67
71
 
283
287
                details[MongoStats.vsize],
284
288
                details[MongoStats.res],
285
289
            ))
286
 
    first_timestamp = data_lines[0].timestamp
287
 
    final_timestamp = data_lines[-1].timestamp
 
290
    try:
 
291
        first_timestamp = data_lines[0].timestamp
 
292
        final_timestamp = data_lines[-1].timestamp
 
293
    except IndexError:
 
294
        raise NoDataPresent('No data found in mongodb log.')
288
295
    return first_timestamp, final_timestamp, data_lines
289
296
 
290
297