Home Explore Blog CI



postgresql

32th chunk of `doc/src/sgml/ref/pgbench.sgml`
44c42d37f268633de5f5bda497a686d7223b93cf303ab7350000000100000fae
 0 1499414498 34501 3
3 1 8333 0 1499414498 42848 0
3 2 8358 0 1499414498 51219 0
4 0 72345 0 1499414498 59433 6
1 3 41718 0 1499414498 67879 4
1 4 8416 0 1499414498 76311 0
3 3 33235 0 1499414498 84469 3
0 0 failed 0 1499414498 84905 9
2 0 failed 0 1499414498 86248 9
3 4 8307 0 1499414498 92788 0
</screen>
  </para>

  <para>
   If the <option>--failures-detailed</option> option is used, the type of
   failure is reported in the <replaceable>time</replaceable> like this:
<screen>
3 0 47423 0 1499414498 34501 3
3 1 8333 0 1499414498 42848 0
3 2 8358 0 1499414498 51219 0
4 0 72345 0 1499414498 59433 6
1 3 41718 0 1499414498 67879 4
1 4 8416 0 1499414498 76311 0
3 3 33235 0 1499414498 84469 3
0 0 serialization 0 1499414498 84905 9
2 0 serialization 0 1499414498 86248 9
3 4 8307 0 1499414498 92788 0
</screen>
  </para>

  <para>
   When running a long test on hardware that can handle a lot of transactions,
   the log files can become very large.  The <option>--sampling-rate</option> option
   can be used to log only a random sample of transactions.
  </para>
 </refsect2>

 <refsect2>
  <title>Aggregated Logging</title>

  <para>
   With the <option>--aggregate-interval</option> option, a different
   format is used for the log files.  Each log line describes one
   aggregation interval.  It contains the following space-separated
   fields:

   <variablelist>
    <varlistentry>
     <term><replaceable>interval_start</replaceable></term>
     <listitem>
      <para>
       start time of the interval, as a Unix-epoch time stamp
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>num_transactions</replaceable></term>
     <listitem>
      <para>
       number of transactions within the interval
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>sum_latency</replaceable></term>
     <listitem>
      <para>
       sum of transaction latencies
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>sum_latency_2</replaceable></term>
     <listitem>
      <para>
       sum of squares of transaction latencies
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>min_latency</replaceable></term>
     <listitem>
      <para>
       minimum transaction latency
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>max_latency</replaceable></term>
     <listitem>
      <para>
       maximum transaction latency
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>sum_lag</replaceable></term>
     <listitem>
      <para>
       sum of transaction start delays
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>sum_lag_2</replaceable></term>
     <listitem>
      <para>
       sum of squares of transaction start delays
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>min_lag</replaceable></term>
     <listitem>
      <para>
       minimum transaction start delay
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>max_lag</replaceable></term>
     <listitem>
      <para>
       maximum transaction start delay
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>skipped</replaceable></term>
     <listitem>
      <para>
       number of transactions skipped because they would have started too late
       (zero unless <option>--rate</option>
       and <option>--latency-limit</option> are specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>retried</replaceable></term>

Title: pgbench Logging: Sampling and Aggregated Logs
Summary
The first part provides examples of per-transaction log files, illustrating the reporting of failures, retries, and detailed failure types (serialization, deadlock). To manage large log files from extensive tests, the `--sampling-rate` option is introduced, allowing for random sampling of transactions to be logged. The section then transitions to aggregated logging, which is enabled using the `--aggregate-interval` option. This format logs aggregated statistics for each interval, including the start time, number of transactions, sums and sums of squares for latency and lag, minimum and maximum latency and lag, number of skipped transactions, and number of retried transactions within the interval. A variable list describes each space-separated field in detail.