Export the traces using gzip format
This commit is contained in:
@@ -173,5 +173,4 @@ namespace lms::db::utils
|
||||
}
|
||||
|
||||
Wt::WDateTime normalizeDateTime(const Wt::WDateTime& dateTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,6 +58,9 @@ target_include_directories(lms PRIVATE
|
||||
)
|
||||
|
||||
target_link_libraries(lms PRIVATE
|
||||
Boost::iostreams
|
||||
Wt::Wt
|
||||
Wt::HTTP
|
||||
lmsav
|
||||
lmsauth
|
||||
lmsdatabase
|
||||
@@ -68,8 +71,6 @@ target_link_libraries(lms PRIVATE
|
||||
lmsservice-cover
|
||||
lmssubsonic
|
||||
lmscore
|
||||
Wt::Wt
|
||||
Wt::HTTP
|
||||
)
|
||||
|
||||
install(TARGETS lms DESTINATION bin)
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
|
||||
#include "TracingView.hpp"
|
||||
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
#include <boost/iostreams/filter/gzip.hpp>
|
||||
|
||||
#include <Wt/Http/Response.h>
|
||||
#include <Wt/WDateTime.h>
|
||||
#include <Wt/WPushButton.h>
|
||||
@@ -46,9 +49,14 @@ namespace lms::ui
|
||||
|
||||
void handleRequest(const Wt::Http::Request&, Wt::Http::Response& response)
|
||||
{
|
||||
suggestFileName(core::stringUtils::toISO8601String(Wt::WDateTime::currentDateTime()) + "-traces.json");
|
||||
response.setMimeType("application/json");
|
||||
_traceLogger.dumpCurrentBuffer(response.out());
|
||||
response.setMimeType("application/gzip");
|
||||
suggestFileName(core::stringUtils::toISO8601String(Wt::WDateTime::currentDateTime()) + "-traces.json.gz");
|
||||
|
||||
boost::iostreams::filtering_ostream gzipStream;
|
||||
gzipStream.push(boost::iostreams::gzip_compressor{});
|
||||
gzipStream.push(response.out());
|
||||
|
||||
_traceLogger.dumpCurrentBuffer(gzipStream);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user