put fields into system.profile, not a big string SERVER-3061
This commit is contained in:
@@ -1096,7 +1096,32 @@ const StringData _jscode_raw_utils =
|
||||
"}\n"
|
||||
"else {\n"
|
||||
"print();\n"
|
||||
"db.system.profile.find({ millis: { $gt: 0} }).sort({ $natural: -1 }).limit(5).forEach(function (x) { print(\"\" + x.millis + \"ms \" + String(x.ts).substring(0, 24)); print(x.info); print(\"\\n\"); })\n"
|
||||
"db.system.profile.find({ millis: { $gt: 0} }).sort({ $natural: -1 }).limit(5).forEach(\n"
|
||||
"function (x) {\n"
|
||||
"print(\"\" + x.op + \"\\t\" + x.ns + \" \" + x.millis + \"ms \" + String(x.ts).substring(0, 24));\n"
|
||||
"var l = \"\";\n"
|
||||
"for ( var z in x ){\n"
|
||||
"if ( z == \"op\" || z == \"ns\" || z == \"millis\" || z == \"ts\" )\n"
|
||||
"continue;\n"
|
||||
"\n"
|
||||
"var val = x[z];\n"
|
||||
"var mytype = typeof(val);\n"
|
||||
"\n"
|
||||
"if ( mytype == \"string\" ||\n"
|
||||
"mytype == \"number\" )\n"
|
||||
"l += z + \":\" + val + \" \";\n"
|
||||
"else if ( mytype == \"object\" )\n"
|
||||
"l += z + \":\" + tojson(val ) + \" \";\n"
|
||||
"else if ( mytype == \"boolean\" )\n"
|
||||
"l += z + \" \";\n"
|
||||
"else\n"
|
||||
"l += z + \":\" + val + \" \";\n"
|
||||
"\n"
|
||||
"}\n"
|
||||
"print( l );\n"
|
||||
"print(\"\\n\");\n"
|
||||
"}\n"
|
||||
")\n"
|
||||
"}\n"
|
||||
"return \"\";\n"
|
||||
"}\n"
|
||||
|
||||
Reference in New Issue
Block a user