-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Diagnostics
-
Query Execution
In the output from db.currentOp(true), active ops have secs_running and microsecs_running fields which show how long it has been since the operation started.
However, these fields aren't present for ops which aren't currently active, which means that it's impossible to tell how long they have been there.
Possible solutions (in src/mongo/db/curop.cpp) include:
- Also including (micro)secs_running for ops which are inactive (but have started), eg. something like:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
builder->append("active", a); -if( a ) { +if( isStarted() ) { builder->append("secs_running", elapsedSeconds() ); builder->append("microsecs_running", static_cast<long long int>(elapsedMicros()) ); }
This would break anything that relies on these fields being present only when active is true (rather than directly checking for active: true).
- As above, but different field names for inactive ops, eg:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
builder->append("active", a); if( a ) { builder->append("secs_running", elapsedSeconds() ); builder->append("microsecs_running", static_cast<long long int>(elapsedMicros()) ); +} else if (isStarted()) { + builder->append("secs_elapsed", elapsedSeconds() ); + builder->append("microsecs_elapsed", elapsedMicros() ); }
- New fields always present for started ops, eg:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
builder->append("active", a); if( a ) { builder->append("secs_running", elapsedSeconds() ); builder->append("microsecs_running", static_cast<long long int>(elapsedMicros()) ); } +if (isStarted()) { + builder->append("secs_elapsed", elapsedSeconds() ); + builder->append("microsecs_elapsed", elapsedMicros() ); +}
This would have the side effect of helping to resolve
SERVER-18469also.
- As well or instead of the above, but as a direct "started" field, eg:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
builder->append("active", a); +if (isStarted()) { + builder->append("started", _start ); // except converted to a BSON Date object +} + if( a ) { builder->append("secs_running", elapsedSeconds() ); builder->append("microsecs_running", static_cast<long long int>(elapsedMicros()) ); }
- is related to
-
SERVER-26705 Need a command that lists all connections to/from a given mongos or mongod
- Backlog
- related to
-
SERVER-18469 Improve naming of secs_running / microsecs_running
- Closed