Skip to content

Commit

Permalink
Add total latency duration column to io stats.
Browse files Browse the repository at this point in the history
Partially addresses lttng#67
  • Loading branch information
milianw committed Jul 11, 2016
1 parent e21782a commit 41e1ace
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lttnganalyses/cli/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class IoAnalysisCommand(Command):
('max_latency', 'Maximum call latency', mi.Duration),
('stdev_latency', 'System call latency standard deviation',
mi.Duration),
('total_latency', 'Total call latency', mi.Duration),
]
),
(
Expand All @@ -98,6 +99,7 @@ class IoAnalysisCommand(Command):
('max_latency', 'Maximum access latency', mi.Duration),
('stdev_latency', 'System access latency standard deviation',
mi.Duration),
('total_latency', 'Total call latency', mi.Duration),
]
),
(
Expand Down Expand Up @@ -188,8 +190,8 @@ class IoAnalysisCommand(Command):
]
),
]
_LATENCY_STATS_FORMAT = '{:<14} {:>14} {:>14} {:>14} {:>14} {:>14}'
_SECTION_SEPARATOR_STRING = '-' * 89
_LATENCY_STATS_FORMAT = '{:<14} {:>14} {:>14} {:>14} {:>14} {:>14} {:>14}'
_SECTION_SEPARATOR_STRING = '-' * 104

def _analysis_tick(self, begin_ns, end_ns):
syscall_latency_stats_table = None
Expand Down Expand Up @@ -1013,6 +1015,7 @@ def _append_latency_stats_row(self, obj, rq_durations, result_table):
avg_latency=mi.Duration(avg),
max_latency=mi.Duration(max_duration),
stdev_latency=stdev,
total_latency=mi.Duration(total_duration),
)

def _append_latency_stats_row_from_requests(self, obj, io_requests,
Expand Down Expand Up @@ -1066,17 +1069,18 @@ def _print_latency_stats_row(self, row):
stdev = '%0.03f' % row.stdev_latency.to_us()

avg = '%0.03f' % row.avg_latency.to_us()
total_duration = '%0.03f' % row.total_latency.to_us()
min_duration = '%0.03f' % row.min_latency.to_us()
max_duration = '%0.03f' % row.max_latency.to_us()

print(IoAnalysisCommand._LATENCY_STATS_FORMAT.format(
str(row.obj), row.count.value, min_duration,
avg, max_duration, stdev))
avg, max_duration, stdev, total_duration))

def _print_syscall_latency_stats(self, stats_table):
print('\nSyscalls latency statistics (usec):')
print(IoAnalysisCommand._LATENCY_STATS_FORMAT.format(
'Type', 'Count', 'Min', 'Average', 'Max', 'Stdev'))
'Type', 'Count', 'Min', 'Average', 'Max', 'Stdev', 'Total'))
print(IoAnalysisCommand._SECTION_SEPARATOR_STRING)

for row in stats_table.rows:
Expand All @@ -1088,7 +1092,7 @@ def _print_disk_latency_stats(self, stats_table):

print('\nDisk latency statistics (usec):')
print(IoAnalysisCommand._LATENCY_STATS_FORMAT.format(
'Name', 'Count', 'Min', 'Average', 'Max', 'Stdev'))
'Name', 'Count', 'Min', 'Average', 'Max', 'Stdev', 'Total'))
print(IoAnalysisCommand._SECTION_SEPARATOR_STRING)

for row in stats_table.rows:
Expand Down

0 comments on commit 41e1ace

Please sign in to comment.