Skip to content

Commit

Permalink
Implemented
Browse files Browse the repository at this point in the history
SimpleStorageServiceNonBufferized::getNumRunningTransactionsOnDisk()
  • Loading branch information
henricasanova committed Nov 15, 2023
1 parent 8ecf8ff commit 0d53ef8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ namespace wrench {
dst_location(std::move(dst_location)), dst_host(dst_host), dst_disk(dst_disk),
mailbox(mailbox), transfer_size(transfer_size), stream(nullptr) {
}

};

int getNumRunningTransactionsOnDisk(simgrid::s4u::Disk *disk);

/***********************/
/** \endcond **/
/***********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,4 +757,19 @@ namespace wrench {
}
}

/**
* @brief Returns the number of running transactions on a disk, as far as this
* storage service know
* @return a number of transactions
*/
int SimpleStorageServiceNonBufferized::getNumRunningTransactionsOnDisk(simgrid::s4u::Disk *disk) {
int count = 0;
for (const auto &t : this->running_transactions) {
if ((t->src_disk == disk) or (t->dst_disk == disk)) {
count++;
}
}
return count;
}

}// namespace wrench

0 comments on commit 0d53ef8

Please sign in to comment.