add bytes/sec in compression action log output
This commit is contained in:
+5
-7
@@ -20,8 +20,6 @@ list(APPEND CMAKE_PREFIX_PATH ${LOCAL_LIB_DIR})
|
|||||||
include_directories(${LOCAL_INCLUDE_DIR})
|
include_directories(${LOCAL_INCLUDE_DIR})
|
||||||
link_directories(${LOCAL_LIB_DIR})
|
link_directories(${LOCAL_LIB_DIR})
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Library search
|
# Library search
|
||||||
@@ -112,11 +110,6 @@ endif()
|
|||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
add_test(
|
|
||||||
NAME compression
|
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/test-compression.sh)
|
|
||||||
|
|
||||||
file(GLOB TestCases ${CMAKE_SOURCE_DIR}/tests/*.test.txt)
|
file(GLOB TestCases ${CMAKE_SOURCE_DIR}/tests/*.test.txt)
|
||||||
|
|
||||||
foreach(TestCase IN ITEMS ${TestCases})
|
foreach(TestCase IN ITEMS ${TestCases})
|
||||||
@@ -126,6 +119,11 @@ foreach(TestCase IN ITEMS ${TestCases})
|
|||||||
COMMAND ${CMAKE_BINARY_DIR}/newserv replay-log ${TestCase} --config=${CMAKE_SOURCE_DIR}/tests/config.json --require-password=password --require-access-key=111111111111)
|
COMMAND ${CMAKE_BINARY_DIR}/newserv replay-log ${TestCase} --config=${CMAKE_SOURCE_DIR}/tests/config.json --require-password=password --require-access-key=111111111111)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
add_test(
|
||||||
|
NAME compression
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/test-compression.sh)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Installation configuration
|
# Installation configuration
|
||||||
|
|||||||
+4
-2
@@ -617,8 +617,10 @@ int main(int argc, char** argv) {
|
|||||||
string time_str = format_duration(end - start);
|
string time_str = format_duration(end - start);
|
||||||
|
|
||||||
float size_ratio = static_cast<float>(data.size() * 100) / input_bytes;
|
float size_ratio = static_cast<float>(data.size() * 100) / input_bytes;
|
||||||
log_info("%zu (0x%zX) bytes input => %zu (0x%zX) bytes output (%g%%) in %s",
|
double bytes_per_sec = input_bytes / (static_cast<double>(end - start) / 1000000.0);
|
||||||
input_bytes, input_bytes, data.size(), data.size(), size_ratio, time_str.c_str());
|
string bytes_per_sec_str = format_size(bytes_per_sec);
|
||||||
|
log_info("%zu (0x%zX) bytes input => %zu (0x%zX) bytes output (%g%%) in %s (%s / sec)",
|
||||||
|
input_bytes, input_bytes, data.size(), data.size(), size_ratio, time_str.c_str(), bytes_per_sec_str.c_str());
|
||||||
|
|
||||||
write_output_data(data.data(), data.size());
|
write_output_data(data.data(), data.size());
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user