Skip to content

Commit

Permalink
Update Result class to include total and file extent counts
Browse files Browse the repository at this point in the history
  • Loading branch information
janjurca committed May 6, 2024
1 parent 76d6bcc commit 64704ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/filestorm/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class Result {
jsonResult["path"] = result.getPath();
jsonResult["size"] = result.getSize().get_value();
jsonResult["duration"] = result.getDuration().count();
jsonResult["_total_extents_count"] = result.getExtentsCount();
jsonResult["_file_extent_count"] = result.getFileExtentCount();
jsonResult["total_extents_count"] = result.getExtentsCount();
jsonResult["file_extent_count"] = result.getFileExtentCount();
jsonResults.push_back(jsonResult);
}
file << jsonResults.dump(2);
Expand Down
4 changes: 2 additions & 2 deletions source/scenarios/aging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void AgingScenario::run() {
throw std::runtime_error("FALLOCATE not supported on this system");
#elif __linux__ || __unix__ || defined(_POSIX_VERSION)
auto random_file = tree.randomPunchableFile();
logger.debug("Random file pointer: {}", fmt::ptr(random_file));
auto random_file_path = random_file->path(true);
auto block_size = get_block_size().convert<DataUnit::B>().get_value();
std::tuple<size_t, size_t> hole_adress = random_file->getHoleAdress(block_size, true);
Expand All @@ -243,7 +242,7 @@ void AgingScenario::run() {
touched_files.push_back(random_file);
auto duration = action.exec();
if (!random_file->isPunchable(block_size)) {
logger.warn("File {} is not punchable anymore", random_file_path);
logger.debug("File {} is not punchable anymore", random_file_path);
tree.removeFromPunchableFiles(random_file);
}
result.setAction(Result::Action::ALTER_SMALLER_FALLOCATE);
Expand Down Expand Up @@ -356,6 +355,7 @@ void AgingScenario::run() {
logger.debug("Total extents count: {}, File Count {}, F avail files {}, free space {} MB", tree.total_extents_count, tree.all_files.size(), tree.files_for_fallocate.size(),
fs_utils::get_fs_status(getParameter("directory").get_string()).available / 1024 / 1024);
touched_files.clear();
result.setExtentsCount(tree.total_extents_count);
result.commit();
result = Result();
if (tree.findNullPointer()) {
Expand Down

0 comments on commit 64704ad

Please sign in to comment.