Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite574f2a

Browse files
committed
Enhance pgbench -l option to add timestamp. Patch contributed by Greg
Smith. Along with Japanese doc updation by Tasuo Ishii.> This patch changes the way pgbench outputs its latency log files so that> every transaction gets a timestamp and notes which transaction type was> executed. It's a one-line change that just dumps some additional> information that was already sitting in that area of code. I also made a> couple of documentation corrections and clarifications on some of the more> confusing features of pgbench.>> It's straightforward to parse log files in this format to analyze what> happened during the test at a higher level than was possible with the> original format. You can find some rough sample code to convert this> latency format into CVS files and then into graphs at>http://www.westnet.com/~gsmith/content/postgresql/pgbench.htm which I'll> be expanding on once I get all my little patches sent in here.
1 parent7e96269 commite574f2a

File tree

3 files changed

+52
-9
lines changed

3 files changed

+52
-9
lines changed

‎contrib/pgbench/README.pgbench

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$PostgreSQL: pgsql/contrib/pgbench/README.pgbench,v 1.16 2007/04/0608:49:44 ishii Exp $
1+
$PostgreSQL: pgsql/contrib/pgbench/README.pgbench,v 1.17 2007/04/0609:16:15 ishii Exp $
22

33
pgbench README
44

@@ -96,10 +96,14 @@ o options
9696
default is 1. NOTE: scaling factor should be at least
9797
as large as the largest number of clients you intend
9898
to test; else you'll mostly be measuring update contention.
99+
Regular (not initializing) runs using one of the
100+
built-in tests will detect scale based on the number of
101+
branches in the database. For custom (-f) runs it can
102+
be manually specified with this parameter.
99103

100104
-D varname=value
101-
Define a variable. It can berefereed to by a script
102-
provided by using -f option.Multile -D options are allowed.
105+
Define a variable. It can berefered to by a script
106+
provided by using -f option.Multiple -D options are allowed.
103107

104108
-U login
105109
Specify db user's login name if it is different from
@@ -141,9 +145,22 @@ o options
141145
with the name "pgbench_log.xxx", where xxx is the PID
142146
of the pgbench process. The format of the log is:
143147

144-
client_id transaction_no time
148+
client_id transaction_no time file_no time-epoch time-us
145149

146-
where time is measured in microseconds.
150+
where time is measured in microseconds, , the file_no is
151+
which test file was used (useful when multiple were
152+
specified with -f), and time-epoch/time-us are a
153+
UNIX epoch format timestamp followed by an offset
154+
in microseconds (suitable for creating a ISO 8601
155+
timestamp with a fraction of a second) of when
156+
the transaction completed.
157+
158+
Here are example outputs:
159+
160+
0 199 2241 0 1175850568 995598
161+
0 200 2465 0 1175850568 998079
162+
0 201 2513 0 1175850569 608
163+
0 202 2038 0 1175850569 2663
147164

148165
-d
149166
debug option.
@@ -165,6 +182,8 @@ o What is the "transaction" actually performed in pgbench?
165182

166183
(7) end;
167184

185+
If you specify -N, (4) and (5) aren't included in the transaction.
186+
168187
o -f option
169188

170189
This supports for reading transaction script from a specified

‎contrib/pgbench/README.pgbench_jis

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$PostgreSQL: pgsql/contrib/pgbench/README.pgbench_jis,v 1.17 2007/04/0608:49:44 ishii Exp $
1+
$PostgreSQL: pgsql/contrib/pgbench/README.pgbench_jis,v 1.18 2007/04/0609:16:16 ishii Exp $
22

33
pgbench README
44

@@ -76,6 +76,13 @@ pgbench $B$K$O$$$m$$$m$J%*%W%7%g%s$,$"$j$^$9!%(B
7676
$B%G%U%)%k%H$N%9%1!<%j%s%0%U%!%/%?!<$O(B 1 $B$G$9!%(B
7777
-f $B%*%W%7%g%s$G;XDj$7$?%U%!%$%k$+$i%9%1!<%j%s%0%U%!%/(B
7878
$B%?!<$r;2>H$9$k$K$O(B scale $B$H$$$&JQ?tL>$r;HMQ$7$^$9!%(B
79+
$BCm0U(B: $B%9%1!<%j%s%0%U%!%/%?!<$O>/$J$/$H$b(B -c $B$G;XDj$5$l$kF1;~@\(B
80+
$BB3%f!<%6?t$HF1$8$+$=$l$h$j$bBg$-$/$7$F$/$@$5$$!%$G$J$$$H!$(B
81+
pgbench$B$N7k2L$O(BUPDATE$B$N6%9g$KBg$-$/1F6A$5$l$F$7$^$$$^$9!%(B
82+
$BAH9~$_$N%Y%s%A%^!<%/%Q%?!<%s$G$O!$(Bbraches$B$N?t(B(=braches$B%F!<%V%k(B
83+
$B$N9T?t(B)$B$,<+F0E*$K%9%1!<%j%s%0%U%!%/%?!<$K@_Dj$5$l$^$9!%(B
84+
$B%+%9%?%`%/%(%j(B(-f$B%*%W%7%g%s;HMQ(B)$B$G$O!$%9%1!<%j%s%0%U%!%/%?!<$O(B
85+
$B<+F0@_Dj$5$l$^$;$s!%(B
7986

8087
-D varname=value
8188

@@ -130,10 +137,24 @@ pgbench $B$K$O$$$m$$$m$J%*%W%7%g%s$,$"$j$^$9!%(B
130137
$B%+%l%s%H%G%#%l%/%H%j0J2<$N(Bpgbench_log.xxx$B$H$$$&%U%!%$(B
131138
$B%k$G$9!%%U%!%$%k$N%U%)!<%^%C%H$O!$(B
132139

133-
$B%/%i%$%"%s%H(BID$B%H%i%s%6%/%7%g%sHV9f(B $B;~4V(B
140+
$B%/%i%$%"%s%H(BID$B%H%i%s%6%/%7%g%sHV9f(B $B;~4V(B $B%U%!%$%kHV9f(B Unix$B%?%$%`(B($BIC(B) $B%*%U%;%C%H(B
134141

135142
$B$H$J$C$F$$$^$9!%;~4V$O%^%$%/%mICC10L$G$9!%(B
136143

144+
$B%U%!%$%kHV9f$O%F%9%H$K;H$o$l$?%U%!%$%k$NHV9f$G$9(B(-f$B%*%W%7%g%s(B
145+
$B$rJ#?t;XDj$7$?$H$-$KM-MQ$G$9(B)$B!%(B
146+
147+
$B!V(BUnix$B%?%$%`(B($BIC(B) $B%*%U%;%C%H!W$O!$%H%i%s%6%/%7%g%s$,40N;$7$?$H(B
148+
$B$-$N(BUNIX$B%(%]%C%/%?%$%`$H%^%$%/%mICC10L$N%*%U%;%C%H$G$9(B(ISO
149+
8601$B%?%$%`%9%?%s%W$HIC$NCf$NC<?t(B)$B!%(B
150+
151+
$B%m%0$N=PNONc$r<($7$^$9!%(B
152+
153+
0 199 2241 0 1175850568 995598
154+
0 200 2465 0 1175850568 998079
155+
0 201 2513 0 1175850569 608
156+
0 202 2038 0 1175850569 2663
157+
137158
-d$B%G%P%C%0%*%W%7%g%s!%MM!9$J>pJs$,I=<($5$l$^$9!%(B
138159

139160
$B"#%G!<%?%Y!<%9$N=i4|2=(B
@@ -198,6 +219,8 @@ pgbench $B$G$O!$0J2<$N%7!<%1%s%9$rA4It40N;$7$F(B1$B%H%i%s%6%/%7%g%s$H?t$($F(
198219

199220
(7) end;
200221

222+
-N$B%*%W%7%g%s$r;HMQ$9$k$H!$(B(4)(5)$B$O<B9T$5$l$^$;$s!%(B
223+
201224
$B"#F~NO%U%!%$%k$N%U%)!<%^%C%H(B
202225

203226
-f $B%*%W%7%g%s$r;XDj$7$F%H%i%s%6%/%7%g%s$K4^$^$l$k(B SQL $B%3%^%s%I$NFbMF$r(B

‎contrib/pgbench/pgbench.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.63 2007/04/0608:49:44 ishii Exp $
2+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.64 2007/04/0609:16:16 ishii Exp $
33
*
44
* pgbench: a simple benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -469,7 +469,8 @@ doCustom(CState * state, int n, int debug)
469469
diff= (int) (now.tv_sec-st->txn_begin.tv_sec)*1000000.0+
470470
(int) (now.tv_usec-st->txn_begin.tv_usec);
471471

472-
fprintf(LOGFILE,"%d %d %.0f\n",st->id,st->cnt,diff);
472+
fprintf(LOGFILE,"%d %d %.0f %d %ld %ld\n",
473+
st->id,st->cnt,diff,st->use_file,now.tv_sec,now.tv_usec);
473474
}
474475

475476
if (commands[st->state]->type==SQL_COMMAND)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp