diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-07-07 12:04:48 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-07-07 23:17:51 +0000 |
commit | e93fa8a82dffd12d03d0ac4d8a71d83cf75f1eaa (patch) | |
tree | a6f44c1f4e385f70feb2a90d3b0992dfa922d08b /ui/qt/service_response_time_dialog.cpp | |
parent | 5ccd8afe9f3eb0956cd7dce994a677a8cfc9f4bf (diff) | |
download | wireshark-e93fa8a82dffd12d03d0ac4d8a71d83cf75f1eaa.tar.gz |
Add ResponseTimeDelayDialog.
Change-Id: Ie1ea316643a3465763aec71f4a3ef4bf1a5ae639
Reviewed-on: https://code.wireshark.org/review/9548
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/service_response_time_dialog.cpp')
-rw-r--r-- | ui/qt/service_response_time_dialog.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/ui/qt/service_response_time_dialog.cpp b/ui/qt/service_response_time_dialog.cpp index 33f0323f70..17aba9be5e 100644 --- a/ui/qt/service_response_time_dialog.cpp +++ b/ui/qt/service_response_time_dialog.cpp @@ -23,7 +23,6 @@ #include "file.h" -#include <epan/timestats.h> #include <epan/tap.h> #include <ui/service_response_time.h> @@ -34,12 +33,9 @@ #include <QTreeWidget> #include <QTreeWidgetItemIterator> -// To do: - static QHash<const QString, register_srt_t *> cfg_str_to_srt_; extern "C" { -// XXX Need to handle filters. static void srt_init(const char *args, void*) { QStringList args_l = QString(args).split(','); @@ -96,11 +92,7 @@ public: setText(SRT_COLUMN_CALLS, QString::number(procedure_->stats.num)); setText(SRT_COLUMN_MIN, QString::number(nstime_to_sec(&procedure_->stats.min), 'f', 6)); setText(SRT_COLUMN_MAX, QString::number(nstime_to_sec(&procedure_->stats.max), 'f', 6)); - double avg_time = 0.0; - if (procedure_->stats.num) { - avg_time = nstime_to_sec(&procedure_->stats.min) / procedure_->stats.num; - } - setText(SRT_COLUMN_AVG, QString::number(avg_time, 'f', 6)); + setText(SRT_COLUMN_AVG, QString::number(get_average(&procedure_->stats.tot, procedure_->stats.num) / 1000.0, 'f', 6)); setText(SRT_COLUMN_SUM, QString::number(nstime_to_sec(&procedure_->stats.tot), 'f', 6)); for (int col = 0; col < columnCount(); col++) { @@ -127,8 +119,8 @@ public: return nstime_cmp(&procedure_->stats.max, &other_row->procedure_->stats.max) < 0; case SRT_COLUMN_AVG: { - double our_avg = nstime_to_msec(&procedure_->stats.tot) / procedure_->stats.num; - double other_avg = nstime_to_msec(&other_row->procedure_->stats.tot) / other_row->procedure_->stats.num; + double our_avg = get_average(&procedure_->stats.tot, procedure_->stats.num); + double other_avg = get_average(&other_row->procedure_->stats.tot, other_row->procedure_->stats.num); return our_avg < other_avg; } case SRT_COLUMN_SUM: @@ -140,13 +132,10 @@ public: return QTreeWidgetItem::operator< (other); } QList<QVariant> rowData() { - double avg_time = 0.0; - if (procedure_->stats.num) { - avg_time = nstime_to_sec(&procedure_->stats.min) / procedure_->stats.num; - } return QList<QVariant>() << QString(procedure_->procedure) << procedure_->index << procedure_->stats.num << nstime_to_sec(&procedure_->stats.min) << nstime_to_sec(&procedure_->stats.max) - << avg_time << nstime_to_sec(&procedure_->stats.tot); + << get_average(&procedure_->stats.tot, procedure_->stats.num) / 1000.0 + << nstime_to_sec(&procedure_->stats.tot); } private: const srt_procedure_t *procedure_; @@ -264,10 +253,9 @@ TapParameterDialog *ServiceResponseTimeDialog::createSrtDialog(QWidget &parent, return new ServiceResponseTimeDialog(parent, cf, srt, filter); } -QTreeWidgetItem *ServiceResponseTimeDialog::addSrtTable(const struct _srt_stat_table *srt_table) +void ServiceResponseTimeDialog::addSrtTable(const struct _srt_stat_table *srt_table) { - SrtTableTreeWidgetItem *srtt_ti = new SrtTableTreeWidgetItem(statsTreeWidget(), srt_table); - return srtt_ti; + new SrtTableTreeWidgetItem(statsTreeWidget(), srt_table); } void ServiceResponseTimeDialog::tapReset(void *srtd_ptr) |