Skip to content

Commit 83dc590

Browse files
committed
pg_test_fsync: Update output format
Apparently, computers are now a bit faster than when this was first added, 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 consistent line length.
1 parent af2b8fd commit 83dc590

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
#define XLOG_BLCKSZ_K (XLOG_BLCKSZ / 1024)
2525

26-
#define LABEL_FORMAT " %-32s"
26+
#define LABEL_FORMAT " %-30s"
2727
#define NA_FORMAT "%20s"
28-
#define OPS_FORMAT "%11.3f ops/sec %6.0f usecs/op"
28+
#define OPS_FORMAT "%13.3f ops/sec %6.0f usecs/op"
2929
#define USECS_SEC 1000000
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 write open_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 different descriptor.)\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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy