@@ -355,7 +355,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
355355 <term><option>--log</option></term>
356356 <listitem>
357357 <para>
358- Writethe time taken by each transaction to a log file.
358+ Writeinformation about each transaction to a log file.
359359 See below for details.
360360 </para>
361361 </listitem>
@@ -572,13 +572,9 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
572572 <term><option>--aggregate-interval=<replaceable>seconds</></option></term>
573573 <listitem>
574574 <para>
575- Length of aggregation interval (in seconds). May be used only together
576- with <application>-l</application> - with this option, the log contains
577- per-interval summary (number of transactions, min/max latency and two
578- additional fields useful for variance estimation).
579- </para>
580- <para>
581- This option is not currently supported on Windows.
575+ Length of aggregation interval (in seconds). May be used only
576+ with <option>-l</option> option. With this option, the log contains
577+ per-interval summary data, as described below.
582578 </para>
583579 </listitem>
584580 </varlistentry>
@@ -618,8 +614,8 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
618614 <term><option>--log-prefix=<replaceable>prefix</></option></term>
619615 <listitem>
620616 <para>
621- Set the filename prefix for the transaction logfile created by
622- <option>--log</>. The default is <replaceable >pgbench_log</>.
617+ Set the filename prefix for the transaction logfiles created by
618+ <option>--log</>. The default is <literal >pgbench_log</>.
623619 </para>
624620 </listitem>
625621 </varlistentry>
@@ -1128,38 +1124,44 @@ END;
11281124 <title>Per-Transaction Logging</title>
11291125
11301126 <para>
1131- With the <option>-l</> option but without the <option>--aggregate-interval</option>,
1132- <application>pgbench</> writes the time taken by each transaction
1127+ With the <option>-l</> option (but without
1128+ the <option>--aggregate-interval</option> option),
1129+ <application>pgbench</> writes information about each transaction
11331130 to a log file. The log file will be named
11341131 <filename><replaceable>prefix</>.<replaceable>nnn</></filename>,
11351132 where <replaceable>prefix</> defaults to <literal>pgbench_log</>, and
11361133 <replaceable>nnn</> is the PID of the
1137- <application>pgbench</application> process. If the <option>-j</> option is 2 or higher,
1138- creating multiple worker threads, each will have its own log file. The first worker will
1134+ <application>pgbench</application> process.
1135+ The prefix can be changed by using the <option>--log-prefix</> option.
1136+ If the <option>-j</> option is 2 or higher, so that there are multiple
1137+ worker threads, each will have its own log file. The first worker will
11391138 use the same name for its log file as in the standard single worker case.
11401139 The additional log files for the other workers will be named
1141- <filename><replaceable>pgbench_log </>.<replaceable>nnn</>.<replaceable>mmm</></filename>,
1140+ <filename><replaceable>prefix </>.<replaceable>nnn</>.<replaceable>mmm</></filename>,
11421141 where <replaceable>mmm</> is a sequential number for each worker starting
1143- with 1. The prefix can be changed by using the <option>--log-prefix</>
1144- option.
1142+ with 1.
11451143 </para>
11461144
11471145 <para>
11481146 The format of the log is:
11491147
11501148<synopsis>
1151- <replaceable>client_id</> <replaceable>transaction_no</> <replaceable>time</> <replaceable>script_no</> <replaceable>time_epoch</> <replaceable>time_us</> <optional><replaceable>schedule_lag</replaceable></optional>
1149+ <replaceable>client_id</> <replaceable>transaction_no</> <replaceable>time</> <replaceable>script_no</> <replaceable>time_epoch</> <replaceable>time_us</> <optional> <replaceable>schedule_lag</replaceable> </optional>
11521150</synopsis>
11531151
1154- where <replaceable>time</> is the total elapsed transaction time in microseconds,
1152+ where
1153+ <replaceable>client_id</> indicates which client session ran the transaction,
1154+ <replaceable>transaction_no</> counts how many transactions have been
1155+ run by that session,
1156+ <replaceable>time</> is the total elapsed transaction time in microseconds,
11551157 <replaceable>script_no</> identifies which script file was used (useful when
11561158 multiple scripts were specified with <option>-f</> or <option>-b</>),
11571159 and <replaceable>time_epoch</>/<replaceable>time_us</> are a
1158- Unix epoch format time stamp and an offset
1160+ Unix- epoch time stamp and an offset
11591161 in microseconds (suitable for creating an ISO 8601
11601162 time stamp with fractional seconds) showing when
11611163 the transaction completed.
1162- Field <replaceable>schedule_lag</> is the difference between the
1164+ The <replaceable>schedule_lag</> field is the difference between the
11631165 transaction's scheduled start time, and the time it actually started, in
11641166 microseconds. It is only present when the <option>--rate</> option is used.
11651167 When both <option>--rate</> and <option>--latency-limit</> are used,
@@ -1168,15 +1170,16 @@ END;
11681170 </para>
11691171
11701172 <para>
1171- Here is a snippet ofthe log file generated:
1173+ Here is a snippet ofa log file generated in a single-client run :
11721174<screen>
117311750 199 2241 0 1175850568 995598
117411760 200 2465 0 1175850568 998079
117511770 201 2513 0 1175850569 608
117611780 202 2038 0 1175850569 2663
11771179</screen>
11781180
1179- Another example with --rate=100 and --latency-limit=5 (note the additional
1181+ Another example with <literal>--rate=100</>
1182+ and <literal>--latency-limit=5</> (note the additional
11801183 <replaceable>schedule_lag</> column):
11811184<screen>
118211850 81 4621 0 1412881037 912698 3005
@@ -1203,32 +1206,41 @@ END;
12031206 <title>Aggregated Logging</title>
12041207
12051208 <para>
1206- With the <option>--aggregate-interval</option> option, the logs use a bit different format:
1209+ With the <option>--aggregate-interval</option> option, a different
1210+ format is used for the log files:
12071211
12081212<synopsis>
1209- <replaceable>interval_start</> <replaceable>num_of_transactions </> <replaceable>latency_sum </> <replaceable>latency_2_sum </> <replaceable>min_latency</> <replaceable>max_latency</> <optional><replaceable>lag_sum </> <replaceable>lag_2_sum </> <replaceable>min_lag</> <replaceable>max_lag</> <optional><replaceable>skipped_transactions </></optional></optional>
1213+ <replaceable>interval_start</> <replaceable>num_transactions </> <replaceable>sum_latency </> <replaceable>sum_latency_2 </> <replaceable>min_latency</> <replaceable>max_latency</> <optional> <replaceable>sum_lag </> <replaceable>sum_lag_2 </> <replaceable>min_lag</> <replaceable>max_lag</> <optional> <replaceable>skipped </> </optional> </optional>
12101214</synopsis>
12111215
1212- where <replaceable>interval_start</> is the start of the interval (Unix epoch
1213- format time stamp), <replaceable>num_of_transactions</> is the number of transactions
1214- within the interval, <replaceable>latency_sum</replaceable> is a sum of latencies
1215- (so you can compute average latency easily). The following two fields are useful
1216- for variance estimation - <replaceable>latency_sum</> is a sum of latencies and
1217- <replaceable>latency_2_sum</> is a sum of 2nd powers of latencies. The next two
1218- fields are <replaceable>min_latency</> - a minimum latency within the interval, and
1219- <replaceable>max_latency</> - maximum latency within the interval. A transaction is
1220- counted into the interval when it was committed. The fields in the end,
1221- <replaceable>lag_sum</>, <replaceable>lag_2_sum</>, <replaceable>min_lag</>,
1216+ where
1217+ <replaceable>interval_start</> is the start of the interval (as a Unix
1218+ epoch time stamp),
1219+ <replaceable>num_transactions</> is the number of transactions
1220+ within the interval,
1221+ <replaceable>sum_latency</replaceable> is the sum of the transaction
1222+ latencies within the interval,
1223+ <replaceable>sum_latency_2</replaceable> is the sum of squares of the
1224+ transaction latencies within the interval,
1225+ <replaceable>min_latency</> is the minimum latency within the interval,
1226+ and
1227+ <replaceable>max_latency</> is the maximum latency within the interval.
1228+ The next fields,
1229+ <replaceable>sum_lag</>, <replaceable>sum_lag_2</>, <replaceable>min_lag</>,
12221230 and <replaceable>max_lag</>, are only present if the <option>--rate</>
1223- option is used. The very last one, <replaceable>skipped_transactions</>,
1224- is only present if the option <option>--latency-limit</> is present, too.
1225- They are calculated from the time each transaction had to wait for the
1231+ option is used.
1232+ They provide statistics about the time each transaction had to wait for the
12261233 previous one to finish, i.e. the difference between each transaction's
12271234 scheduled start time and the time it actually started.
1235+ The very last field, <replaceable>skipped</>,
1236+ is only present if the <option>--latency-limit</> option is used, too.
1237+ It counts the number of transactions skipped because they would have
1238+ started too late.
1239+ Each transaction is counted in the interval when it was committed.
12281240 </para>
12291241
12301242 <para>
1231- Here is example output:
1243+ Here issome example output:
12321244<screen>
123312451345828501 5601 1542744 483552416 61 2573
123412461345828503 7884 1979812 565806736 60 1479
@@ -1238,9 +1250,9 @@ END;
12381250</screen></para>
12391251
12401252 <para>
1241- Notice that while the plain (unaggregated) log filecontains a reference
1242- to the custom script files , the aggregated log does not. Therefore if
1243- you need per script data, you need to aggregate the data on your own.
1253+ Notice that while the plain (unaggregated) log fileshows which script
1254+ was used for each transaction , the aggregated log does not. Therefore if
1255+ you need per- script data, you need to aggregate the data on your own.
12441256 </para>
12451257
12461258 </refsect2>