Skip to content
Snippets Groups Projects
Commit f1572a63 authored by armar-user's avatar armar-user
Browse files

(FP, RK) Add debug output

parent 1566732d
No related branches found
No related tags found
1 merge request!183ArViz: Replace Coin timer by QtTimer to fix ArViz from freezing...
......@@ -272,6 +272,10 @@ namespace armarx::viz
void CoinVisualizer::update()
{
{
std::lock_guard lock(timingMutex);
lastTiming.updateToggle = (lastTiming.updateToggle + 1) % 10;
}
switch (state)
{
case CoinVisualizerState::STARTING:
......@@ -312,6 +316,7 @@ namespace armarx::viz
// We should restart the pull for updates so it can run in parallel
data::LayerUpdates currentUpdates = pulledUpdates;
updateResult = CoinVisualizerUpdateResult::WAITING;
timing.waitStart = time_start;
storage->begin_pullUpdatesSince(currentUpdates.revision, callback);
auto layerIDsBefore = getLayerIDs();
......@@ -343,6 +348,7 @@ namespace armarx::viz
// Copy the timing result
std::lock_guard lock(timingMutex);
timing.counter = lastTiming.counter + 1;
timing.updateToggle = lastTiming.updateToggle;
lastTiming = std::move(timing);
}
}
......@@ -350,7 +356,13 @@ namespace armarx::viz
case CoinVisualizerUpdateResult::WAITING:
{
// Still waiting for result
} break;
{
// Copy the timing result
std::lock_guard lock(timingMutex);
lastTiming.waitDuration = IceUtil::Time::now() - lastTiming.waitStart;
}
}
break;
case CoinVisualizerUpdateResult::FAILURE:
{
std::unique_lock<std::mutex> lock(stateMutex);
......
......@@ -174,6 +174,11 @@ namespace armarx::viz
IceUtil::Time layersChanged = IceUtil::Time::seconds(0);
IceUtil::Time total = IceUtil::Time::seconds(0);
IceUtil::Time waitStart = IceUtil::Time::seconds(0);
IceUtil::Time waitDuration = IceUtil::Time::seconds(0);
int updateToggle = 0;
int counter = 0;
};
......
......@@ -452,7 +452,7 @@ namespace armarx
void ArVizWidgetController::onTimingObserverUpdate()
{
viz::CoinVisualizer_UpdateTiming timing = visualizer.getTiming();
if (timing.counter > lastTiming.counter)
//if (timing.counter > lastTiming.counter)
{
if (debugObserver)
{
......@@ -462,6 +462,8 @@ namespace armarx
timingMap["1.2 apply, updateElements (ms)"] = new Variant(timing.applyTotal.updateElements.toMilliSecondsDouble());
timingMap["1.3 apply, removeElements (ms)"] = new Variant(timing.applyTotal.removeElements.toMilliSecondsDouble());
timingMap["2. layers (ms)"] = new Variant(timing.layersChanged.toMilliSecondsDouble());
timingMap["3. wait duration (ms)"] = new Variant(timing.waitDuration.toMilliSecondsDouble());
timingMap["4. update toggle"] = new Variant(timing.updateToggle);
timingMap["total (ms)"] = new Variant(timing.total.toMilliSecondsDouble());
timings.push_back(timing.total.toMilliSecondsDouble());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment