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

Commit83dc590

Browse files
committed
pg_test_fsync: Update output format
Apparently, computers are now a bit faster than when this was firstadded, so we need to make room for a digit or two in the ops/sec format.While we're at it, adjust some of the other output for a more consistentline length.
1 parentaf2b8fd commit83dc590

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

‎contrib/pg_test_fsync/pg_test_fsync.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
#defineXLOG_BLCKSZ_K(XLOG_BLCKSZ / 1024)
2525

26-
#defineLABEL_FORMAT" %-32s"
26+
#defineLABEL_FORMAT" %-30s"
2727
#defineNA_FORMAT"%20s"
28-
#defineOPS_FORMAT"%11.3f ops/sec %6.0f usecs/op"
28+
#defineOPS_FORMAT"%13.3f ops/sec %6.0f usecs/op"
2929
#defineUSECS_SEC1000000
3030

3131
/* These are macros to avoid timing the function call overhead. */
@@ -242,8 +242,7 @@ test_sync(int writes_per_op)
242242
printf("\nCompare file sync methods using one %dkB write:\n",XLOG_BLCKSZ_K);
243243
else
244244
printf("\nCompare file sync methods using two %dkB writes:\n",XLOG_BLCKSZ_K);
245-
printf("(in wal_sync_method preference order, except fdatasync\n");
246-
printf("is Linux's default)\n");
245+
printf("(in wal_sync_method preference order, except fdatasync is Linux's default)\n");
247246

248247
/*
249248
* Test open_datasync if available
@@ -398,8 +397,8 @@ static void
398397
test_open_syncs(void)
399398
{
400399
printf("\nCompare open_sync with different write sizes:\n");
401-
printf("(This is designed to compare the cost of writing 16kB\n");
402-
printf("in different writeopen_sync sizes.)\n");
400+
printf("(This is designed to compare the cost of writing 16kB in different write\n"
401+
"open_sync sizes.)\n");
403402

404403
test_open_sync(" 1 * 16kB open_sync write",16);
405404
test_open_sync(" 2 * 8kB open_sync writes",8);
@@ -459,8 +458,8 @@ test_file_descriptor_sync(void)
459458
* on platforms which support it.
460459
*/
461460
printf("\nTest if fsync on non-write file descriptor is honored:\n");
462-
printf("(If the times are similar, fsync() can sync data written\n");
463-
printf("on a differentdescriptor.)\n");
461+
printf("(If the times are similar, fsync() can sync data written on a different\n"
462+
"descriptor.)\n");
464463

465464
/*
466465
* first write, fsync and close, which is the normal behavior without
@@ -524,7 +523,7 @@ test_non_sync(void)
524523
/*
525524
* Test a simple write without fsync
526525
*/
527-
printf("\nNon-Sync'ed %dkB writes:\n",XLOG_BLCKSZ_K);
526+
printf("\nNon-sync'ed %dkB writes:\n",XLOG_BLCKSZ_K);
528527
printf(LABEL_FORMAT,"write");
529528
fflush(stdout);
530529

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp