osrf / gazebo_experimental

Repo for Gazebo 9 development. Starting from entity_component_system_prototype branch on gazebo repo. This repo will be merged back into the gazebo repo in the future.
0 stars 1 forks source link

Add time taken metrics and a way to view them in real time #16

Closed osrf-migration closed 7 years ago

osrf-migration commented 7 years ago

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Having a way to see timing information in real time will be useful for future debugging and profiling. Useful metrics are

  1. How long is each system taking to update?
  2. How long is it taking to update all systems?
  3. How long is it taking to apply changes to the entities and components?

This kind of information would inform decisions about where time should be spent optimizing code, or where bugs might be occurring.

osrf-migration commented 7 years ago

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Maybe some of the diagnostics stuff from Gazebo can be reused here. I believe there is also a branch on Gazebo where this is enabled. @scpeters

osrf-migration commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


osrf-migration commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Related info

osrf-migration commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


A loose port of gazebo::util::DiagnosticsManager is on the branch diagnostic_timer. The class gazebo::ecs::Manager has been modified to publish diagnostics during the two phases of Manager::UpdateSystems(). This is published to the topic diagnostics using ignition::msgs::Diagnostics.

Remaining work

osrf-migration commented 7 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I have two branches that I just resolved conflicts for in gazebo, though I haven't checked that they compile. The current diagnostics system lets you get timing info by placing macros throughout the code and then publishing it and writing it to a file.

World::Update                                     maxAbs 6.073124e-03   mean   8.419458e-04   
World::Update::ContactManager::PublishContacts    maxAbs 6.070371e-03   mean   8.404391e-04   
World::Update::LogRecordNotify                    maxAbs 6.007031e-03   mean   8.104208e-04   
World::Update::PhysicsEngine::UpdatePhysics       maxAbs 4.618062e-03   mean   7.611499e-04   
World::Update::PhysicsEngine::UpdateCollision     maxAbs 2.952573e-03   mean   1.157201e-04   
World::Update::SetWorldPose(dirtyPoses)           maxAbs 6.002424e-03   mean   8.091370e-04   
World::Update::Model::Update                      maxAbs 5.938560e-04   mean   4.594276e-05   
World::Update::Events::worldUpdateBegin           maxAbs 1.122670e-04   mean   3.632071e-06   
World::Update::needsReset                         maxAbs 5.240300e-05   mean   3.203250e-07   
osrf-migration commented 7 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


pull request #22 was merged