Skip to content

Commit

Permalink
Rename None to Aggregate in enum.
Browse files Browse the repository at this point in the history
The `None` member of the storage statistics enum was utilized to
hold the aggregate statistics of all access types; this commit renames
it to `Aggregate` in order to make the point of the member clearer.
  • Loading branch information
bbockelm committed Mar 15, 2018
1 parent efda53e commit 3329622
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion IOPool/Input/src/InputFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace edm {
label = StorageAccount::OpenLabel::SecondarySource;
break;
default:
label = StorageAccount::OpenLabel::None;
label = StorageAccount::OpenLabel::Aggregate;
assert(true);
}
// Sets a label for statistics collection; it is a thread-local that is unset when the
Expand Down
2 changes: 1 addition & 1 deletion Utilities/StorageFactory/interface/StorageAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class StorageAccount {
};

enum class OpenLabel {
None,
Aggregate,
Primary,
SecondaryFile,
SecondarySource
Expand Down
2 changes: 1 addition & 1 deletion Utilities/StorageFactory/src/StatisticsSenderService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ StatisticsSenderService::FileStatistics::fillUDP(std::ostringstream &os) {
ssize_t read_vector_square = 0;
ssize_t read_vector_count_sum = 0;
ssize_t read_vector_count_square = 0;
auto token = StorageAccount::tokenForStorageClassName("tstoragefile", StorageAccount::OpenLabel::None);
auto token = StorageAccount::tokenForStorageClassName("tstoragefile", StorageAccount::OpenLabel::Aggregate);
for (StorageAccount::StorageStats::const_iterator i = stats.begin (); i != stats.end(); ++i) {
if (i->first == token.value()) {
continue;
Expand Down
8 changes: 4 additions & 4 deletions Utilities/StorageFactory/src/StorageAccount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const std::array<StorageAccount::Operation, 22> StorageAccount::allOperations{ {
Operation::writev
} };

thread_local StorageAccount::OpenLabel StorageAccount::OpenLabelToken::s_label{OpenLabel::None};
thread_local StorageAccount::OpenLabel StorageAccount::OpenLabelToken::s_label{OpenLabel::Aggregate};

static std::string i2str(int i) {
std::ostringstream t;
Expand All @@ -93,7 +93,7 @@ void StorageAccount::aggregateStatistics() {
protocols.insert(item.first.second);
}
for (auto const &protocol : protocols) {
auto token = tokenForStorageClassName(protocol, OpenLabel::None);
auto token = tokenForStorageClassName(protocol, OpenLabel::Aggregate);
OperationStats protocol_stats;
for (auto &item : m_stats) {
if (item.first == token.value()) {
Expand Down Expand Up @@ -149,7 +149,7 @@ StorageAccount::summaryText (bool banner /*=false*/) {
for (auto i = s_nameToToken.begin (); i != s_nameToToken.end(); ++i) {
auto const& opStats = m_stats[i->second];
for (auto j = opStats.begin (); j != opStats.end (); ++j, first = false) {
if (i->first.first != OpenLabel::None) continue;
if (i->first.first != OpenLabel::Aggregate) continue;
if (j->second.attempts == 0) continue;
os << (first ? "" : "; ")
<< (i->first.second) << '/'
Expand All @@ -176,7 +176,7 @@ StorageAccount::fillSummary(std::map<std::string, std::string>& summary) {
for (auto j = opStats.begin(); j != opStats.end(); ++j) {
std::ostringstream os;
if (j->second.attempts == 0) continue;
if (i->first.first == OpenLabel::None) {
if (i->first.first == OpenLabel::Aggregate) {
os << "Timing-" << i->first.second << "-" << kOperationNames[j->first] << "-";
} else {
os << "Timing-" << kLabelNames[static_cast<int>(i->first.first)]
Expand Down

0 comments on commit 3329622

Please sign in to comment.