loolwsd/LOOLWSD.cpp   |    3 +++
 loolwsd/LOOLWSD.hpp   |    9 +++++++++
 loolwsd/TraceFile.hpp |   10 +++++++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit d5aa200471b91077af66772a39135bac444f5879
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Tue Aug 2 21:09:01 2016 -0400

    loolstress: trace events
    
    Change-Id: I1a38ab37dc5d276cdf5336fb04b0ad372804a00d
    Reviewed-on: https://gerrit.libreoffice.org/27965
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 74f22af..187c68f 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -683,6 +683,8 @@ private:
             // Wait until the client has connected with a prison socket.
             waitBridgeCompleted(session);
 
+            LOOLWSD::dumpEventTrace(docBroker->getJailId(), id, "NewSession");
+
             // Now the bridge beetween the client and kit process is connected
             status = "statusindicator: ready";
             Log::trace("Sending to Client [" + status + "].");
@@ -758,6 +760,7 @@ private:
                 Admin::instance().rmDoc(docKey);
             }
 
+            LOOLWSD::dumpEventTrace(docBroker->getJailId(), id, "EndSession");
             Log::info("Finishing GET request handler for session [" + id + "]. 
Joining the queue.");
             queue->put("eof");
             queueHandlerThread.join();
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index 5d14171..588c37d 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -62,6 +62,15 @@ public:
     }
 
     static
+    void dumpEventTrace(const std::string& pId, const std::string& sessionId, 
const std::string& data)
+    {
+        if (TraceDumper)
+        {
+            TraceDumper->writeEvent(pId, sessionId, data);
+        }
+    }
+
+    static
     void dumpIncomingTrace(const std::string& data)
     {
         if (TraceDumper)
diff --git a/loolwsd/TraceFile.hpp b/loolwsd/TraceFile.hpp
index a5dc558..6e8a6a9 100644
--- a/loolwsd/TraceFile.hpp
+++ b/loolwsd/TraceFile.hpp
@@ -21,7 +21,8 @@ public:
     {
         Invalid = 0,
         Incoming = '>',
-        Outgoing = '<'
+        Outgoing = '<',
+        Event = '-'
     };
 
     TraceFileRecord() :
@@ -49,6 +50,13 @@ public:
         _stream.close();
     }
 
+    void writeEvent(const std::string& pId, const std::string& sessionId, 
const std::string& data)
+    {
+        (void)pId;
+        (void)sessionId;
+        write(data, static_cast<char>(TraceFileRecord::Direction::Event));
+    }
+
     void writeIncoming(const std::string& data)
     {
         write(data, static_cast<char>(TraceFileRecord::Direction::Incoming));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to