OSDN Git Service

Add I/O Timings in text plan representation
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Thu, 25 Aug 2016 00:32:13 +0000 (09:32 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 26 Aug 2016 04:30:44 +0000 (13:30 +0900)
Add I/O Timings which has been forgotten in text representation.

pgsp_json_text.c

index 5d6df82..7d7785b 100644 (file)
@@ -533,6 +533,27 @@ print_current_node(pgspParserContext *ctx)
                        comma =true;
                }
        }
+       if (!ISZERO(v->io_read_time) ||
+               !ISZERO(v->io_write_time))
+       {
+               /* Feed a line if any of Buffers: items has been shown */
+               if (comma)
+                       appendStringInfoString(s, "\n");
+                       
+               appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
+               appendStringInfoString(s, "I/O Timings: ");
+
+               if (!ISZERO(v->io_read_time))
+               {
+                       appendStringInfoString(s, " read=");
+                       appendStringInfoString(s, v->io_read_time);
+               }
+               if (!ISZERO(v->io_write_time))
+               {
+                       appendStringInfoString(s, " write=");
+                       appendStringInfoString(s, v->io_write_time);
+               }
+       }
 }
 
 static void