@@ -355,7 +355,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
355
355
<term><option>--log</option></term>
356
356
<listitem>
357
357
<para>
358
- Write the time taken by each transaction to a log file.
358
+ Write information about each transaction to a log file.
359
359
See below for details.
360
360
</para>
361
361
</listitem>
@@ -572,13 +572,9 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
572
572
<term><option>--aggregate-interval=<replaceable>seconds</></option></term>
573
573
<listitem>
574
574
<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.
582
578
</para>
583
579
</listitem>
584
580
</varlistentry>
@@ -618,8 +614,8 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
618
614
<term><option>--log-prefix=<replaceable>prefix</></option></term>
619
615
<listitem>
620
616
<para>
621
- Set the filename prefix for the transaction log file created by
622
- <option>--log</>. The default is <replaceable >pgbench_log</>.
617
+ Set the filename prefix for the transaction log files created by
618
+ <option>--log</>. The default is <literal >pgbench_log</>.
623
619
</para>
624
620
</listitem>
625
621
</varlistentry>
@@ -1128,38 +1124,44 @@ END;
1128
1124
<title>Per-Transaction Logging</title>
1129
1125
1130
1126
<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
1133
1130
to a log file. The log file will be named
1134
1131
<filename><replaceable>prefix</>.<replaceable>nnn</></filename>,
1135
1132
where <replaceable>prefix</> defaults to <literal>pgbench_log</>, and
1136
1133
<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
1139
1138
use the same name for its log file as in the standard single worker case.
1140
1139
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>,
1142
1141
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.
1145
1143
</para>
1146
1144
1147
1145
<para>
1148
1146
The format of the log is:
1149
1147
1150
1148
<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>
1152
1150
</synopsis>
1153
1151
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,
1155
1157
<replaceable>script_no</> identifies which script file was used (useful when
1156
1158
multiple scripts were specified with <option>-f</> or <option>-b</>),
1157
1159
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
1159
1161
in microseconds (suitable for creating an ISO 8601
1160
1162
time stamp with fractional seconds) showing when
1161
1163
the transaction completed.
1162
- Field <replaceable>schedule_lag</> is the difference between the
1164
+ The <replaceable>schedule_lag</> field is the difference between the
1163
1165
transaction's scheduled start time, and the time it actually started, in
1164
1166
microseconds. It is only present when the <option>--rate</> option is used.
1165
1167
When both <option>--rate</> and <option>--latency-limit</> are used,
@@ -1168,15 +1170,16 @@ END;
1168
1170
</para>
1169
1171
1170
1172
<para>
1171
- Here is a snippet of the log file generated:
1173
+ Here is a snippet of a log file generated in a single-client run :
1172
1174
<screen>
1173
1175
0 199 2241 0 1175850568 995598
1174
1176
0 200 2465 0 1175850568 998079
1175
1177
0 201 2513 0 1175850569 608
1176
1178
0 202 2038 0 1175850569 2663
1177
1179
</screen>
1178
1180
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
1180
1183
<replaceable>schedule_lag</> column):
1181
1184
<screen>
1182
1185
0 81 4621 0 1412881037 912698 3005
@@ -1203,32 +1206,41 @@ END;
1203
1206
<title>Aggregated Logging</title>
1204
1207
1205
1208
<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:
1207
1211
1208
1212
<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>
1210
1214
</synopsis>
1211
1215
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</>,
1222
1230
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
1226
1233
previous one to finish, i.e. the difference between each transaction's
1227
1234
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.
1228
1240
</para>
1229
1241
1230
1242
<para>
1231
- Here is example output:
1243
+ Here is some example output:
1232
1244
<screen>
1233
1245
1345828501 5601 1542744 483552416 61 2573
1234
1246
1345828503 7884 1979812 565806736 60 1479
@@ -1238,9 +1250,9 @@ END;
1238
1250
</screen></para>
1239
1251
1240
1252
<para>
1241
- Notice that while the plain (unaggregated) log file contains 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 file shows 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.
1244
1256
</para>
1245
1257
1246
1258
</refsect2>
0 commit comments