[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp loolwsd/MessageQueue.cpp loolwsd/TileCache.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Thu Sep 22 03:33:12 UTC 2016
loolwsd/LOOLKit.cpp | 9 +++++++--
loolwsd/MessageQueue.cpp | 4 ++--
loolwsd/TileCache.cpp | 1 +
3 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 1641f756b2ee15e742e5a3545a074bceea8d9ee4
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Wed Sep 21 09:09:35 2016 -0400
loolwsd: improved logging
Change-Id: I1a1559754efcb0614875dc76ae0637ed6dc1ba77
Reviewed-on: https://gerrit.libreoffice.org/29160
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 0d7b1ff..36b7817 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -666,13 +666,16 @@ public:
return;
}
+ const double area = tile.getWidth() * tile.getHeight();
Timestamp timestamp;
_loKitDocument->paintPartTile(pixmap.data(), tile.getPart(),
tile.getWidth(), tile.getHeight(),
tile.getTilePosX(), tile.getTilePosY(),
tile.getTileWidth(), tile.getTileHeight());
+ const auto elapsed = timestamp.elapsed();
Log::trace() << "paintTile at (" << tile.getPart() << ',' << tile.getTilePosX() << ',' << tile.getTilePosY()
- << ") " << "ver: " << tile.getVersion() << " rendered in " << (timestamp.elapsed()/1000.) << " ms" << Log::end;
+ << ") " << "ver: " << tile.getVersion() << " rendered in " << (elapsed/1000.)
+ << " ms (" << area / elapsed << " MP/s)." << Log::end;
const auto mode = static_cast<LibreOfficeKitTileMode>(_loKitDocument->getTileMode());
if (!png::encodeBufferToPNG(pixmap.data(), tile.getWidth(), tile.getHeight(), output, mode))
@@ -741,14 +744,16 @@ public:
return;
}
+ const double area = pixmapWidth * pixmapHeight;
Timestamp timestamp;
_loKitDocument->paintPartTile(pixmap.data(), tileCombined.getPart(),
pixmapWidth, pixmapHeight,
renderArea.getLeft(), renderArea.getTop(),
renderArea.getWidth(), renderArea.getHeight());
+ const auto elapsed = timestamp.elapsed();
Log::debug() << "paintTile (combined) at (" << renderArea.getLeft() << ", " << renderArea.getTop() << "), ("
<< renderArea.getWidth() << ", " << renderArea.getHeight() << ") ver: " << tileCombined.getVersion()
- << " rendered in " << (timestamp.elapsed()/1000.) << " ms." << Log::end;
+ << " rendered in " << (elapsed/1000.) << " ms (" << area / elapsed << " MP/s)." << Log::end;
const auto mode = static_cast<LibreOfficeKitTileMode>(_loKitDocument->getTileMode());
std::vector<char> output;
diff --git a/loolwsd/MessageQueue.cpp b/loolwsd/MessageQueue.cpp
index 0a4c96d..75d6441 100644
--- a/loolwsd/MessageQueue.cpp
+++ b/loolwsd/MessageQueue.cpp
@@ -146,10 +146,10 @@ void TileQueue::put_impl(const Payload& value)
auto& it = _queue[i];
const std::string old(it.data(), it.size());
const auto oldMsg = old.substr(0, old.find(" ver"));
- Log::trace() << "TileQueue #" << i << ": " << oldMsg << Log::end;
+ Log::trace() << "TileQueue #" << i << ": " << old << Log::end;
if (newMsg == oldMsg)
{
- Log::debug() << "Replacing duplicate tile: " << oldMsg << " -> " << newMsg << Log::end;
+ Log::debug() << "Replacing duplicate tile: " << old << " -> " << msg << Log::end;
_queue[i] = value;
if (priority(msg))
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index 6a2053f..88ccaf5 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -330,6 +330,7 @@ void TileCache::invalidateTiles(const std::string& tiles)
}
else if (tokens.count() != 6)
{
+ Log::error("Unexpected invalidatetiles request: " + tiles);
return;
}
else
More information about the Libreoffice-commits
mailing list