Skip to content

Commit

Permalink
ros2GH-138 Move calculation of bag size
Browse files Browse the repository at this point in the history
- previously in rosbag2::Info
- now in storage plugin
  • Loading branch information
Martin-Idel-SI committed Dec 13, 2018
1 parent a963c68 commit 8f5e4de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion rosbag2/src/rosbag2/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ rosbag2::BagMetadata Info::read_metadata(const std::string & uri, const std::str
"opened.");
}
auto bag_metadata = storage->get_metadata();
bag_metadata.bag_size = rosbag2_storage::FilesystemHelper::calculate_directory_size(uri);
return bag_metadata;
}
throw std::runtime_error("The metadata.yaml file does not exist. Please specify a the "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ rosbag2_storage::BagMetadata SqliteStorage::get_metadata()
metadata.starting_time =
std::chrono::time_point<std::chrono::high_resolution_clock>(std::chrono::nanoseconds(min_time));
metadata.duration = std::chrono::nanoseconds(max_time) - std::chrono::nanoseconds(min_time);
metadata.bag_size = rosbag2_storage::FilesystemHelper::calculate_directory_size(database_name_);

return metadata;
}
Expand Down

0 comments on commit 8f5e4de

Please sign in to comment.