Skip to content

Commit

Permalink
Update category display
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Oct 5, 2023
1 parent fa296e0 commit cd3e146
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cpp/scsictl/scsictl_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,14 @@ string ScsictlDisplay::DisplayStatisticsInfo(const PbStatisticsInfo& statistics_
sorted_statistics.emplace(PbStatisticsCategory_Name(statistics.category()), statistics);
}

string prev_category;
for (const auto& [category, statistics] : sorted_statistics) {
s << " " << category << " " << statistics.key() << ": " << statistics.value() << '\n';
if (category != prev_category) {
s << " " << category << '\n';
prev_category = category;
}

s << " " << statistics.key() << ": " << statistics.value() << '\n';
}

return s.str();
Expand Down

0 comments on commit cd3e146

Please sign in to comment.