From 6ea6e7f89ede31637432f09fd32c9ee98a4c6993 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 11 Jul 2020 20:54:58 +0200 Subject: [PATCH] added count for per usage and per service uses --- .../src/gui/statistics/GxsIdStatistics.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp index ba1ec0811..5659179a3 100644 --- a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp @@ -215,6 +215,7 @@ void GxsIdStatisticsWidget::updateContent() ++total_identities; } +#ifdef DEBUG_GXSID_STATISTICS std::cerr << "Identities statistics:" << std::endl; std::cerr << " Usage map:" << std::endl; @@ -226,6 +227,7 @@ void GxsIdStatisticsWidget::updateContent() std::cerr << last_used_hist << std::endl; std::cerr << " Publish date hist: " << std::endl; std::cerr << publish_date_hist << std::endl; +#endif // Now draw the info int the widget's pixmap @@ -258,8 +260,12 @@ void GxsIdStatisticsWidget::updateContent() painter.setFont(times_f) ; painter.drawText(ox,oy,tr("Total identities: ")+QString::number(total_identities)) ; oy += celly*2 ; + uint32_t total_per_type = 0; + for(auto it:usage_map) + total_per_type += it.second; + painter.setFont(times_f) ; - painter.drawText(ox,oy,tr("Usage types: ")) ; oy += 2*celly ; + painter.drawText(ox,oy,tr("Usage types") + "(" + QString::number(total_per_type) + " identities actually used): ") ; oy += 2*celly; for(auto it:usage_map) { @@ -270,8 +276,12 @@ void GxsIdStatisticsWidget::updateContent() // Display per-service statistics + uint32_t total_per_service = 0; + for(auto it:per_service_usage_map) + total_per_service += it.second; + painter.setFont(times_f) ; - painter.drawText(ox,oy,tr("Usage per service: ")) ; oy += 2*celly; + painter.drawText(ox,oy,tr("Usage per service") + "(" + QString::number(total_per_service) + " identities actually used): ") ; oy += 2*celly; for(auto it:per_service_usage_map) {