loolwsd/LOOLStress.cpp | 14 +++++--------- loolwsd/TraceFile.hpp | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 10 deletions(-)
New commits: commit b394ad89d87ef207f6b26d96134b345a8cf07112 Author: Ashod Nakashian <[email protected]> Date: Sun Jul 31 14:17:52 2016 -0400 loolstress: TraceFileReader class added Change-Id: I81d508bb794ca56f647d0eb5b9dd27585100fe07 Reviewed-on: https://gerrit.libreoffice.org/27959 Reviewed-by: Ashod Nakashian <[email protected]> Tested-by: Ashod Nakashian <[email protected]> diff --git a/loolwsd/LOOLStress.cpp b/loolwsd/LOOLStress.cpp index 6232128..6bda492 100644 --- a/loolwsd/LOOLStress.cpp +++ b/loolwsd/LOOLStress.cpp @@ -16,14 +16,9 @@ #include <iostream> #include <random> -#include <Poco/Net/HTMLForm.h> #include <Poco/Net/NetException.h> -#include <Poco/Net/HTTPClientSession.h> -#include <Poco/Net/HTTPSClientSession.h> #include <Poco/Net/HTTPRequest.h> #include <Poco/Net/HTTPResponse.h> -#include <Poco/Net/FilePartSource.h> -#include <Poco/Net/SSLManager.h> #include <Poco/Net/KeyConsoleHandler.h> #include <Poco/Net/AcceptCertificateHandler.h> #include <Poco/StreamCopier.h> @@ -39,14 +34,15 @@ #include <Poco/Util/Option.h> #include <Poco/Util/OptionSet.h> +#include <Poco/Util/Application.h> +#include <Poco/Util/OptionSet.h> + #include "Common.hpp" #include "LOOLProtocol.hpp" +#include "TraceFile.hpp" #include "Util.hpp" #include "test/helpers.hpp" -#include <Poco/Util/Application.h> -#include <Poco/Util/OptionSet.h> - /// Stress testing and performance/scalability benchmarking tool. class Stress: public Poco::Util::Application @@ -115,7 +111,7 @@ public: private: Stress& _app; - std::string _traceFilePath; + TraceFileReader _traceFile; }; Stress::Stress() : diff --git a/loolwsd/TraceFile.hpp b/loolwsd/TraceFile.hpp index 8c61d1f..73713e6 100644 --- a/loolwsd/TraceFile.hpp +++ b/loolwsd/TraceFile.hpp @@ -7,8 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <string> #include <fstream> +#include <mutex> +#include <string> /// Dumps commands and notification trace. class TraceFileWriter @@ -53,4 +54,18 @@ private: std::mutex _mutex; }; +class TraceFileReader +{ +public: + TraceFileReader(const std::string& path) : + _epochStart(Poco::Timestamp().epochMicroseconds()), + _stream(path, std::ios::in) + { + } + +private: + const Poco::Int64 _epochStart; + std::fstream _stream; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
