From 83dc5908c207bc0ff4256eb862f6a211ad5596ec Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Mon, 20 Oct 2014 15:34:59 -0400
Subject: [PATCH] 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.
---
 contrib/pg_test_fsync/pg_test_fsync.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/contrib/pg_test_fsync/pg_test_fsync.c
index 842295ae3d9..3352f046dca 100644
--- a/contrib/pg_test_fsync/pg_test_fsync.c
+++ b/contrib/pg_test_fsync/pg_test_fsync.c
@@ -23,9 +23,9 @@
 
 #define XLOG_BLCKSZ_K	(XLOG_BLCKSZ / 1024)
 
-#define LABEL_FORMAT		"        %-32s"
+#define LABEL_FORMAT		"        %-30s"
 #define NA_FORMAT			"%20s"
-#define OPS_FORMAT			"%11.3f ops/sec  %6.0f usecs/op"
+#define OPS_FORMAT			"%13.3f ops/sec  %6.0f usecs/op"
 #define USECS_SEC			1000000
 
 /* These are macros to avoid timing the function call overhead. */
@@ -242,8 +242,7 @@ test_sync(int writes_per_op)
 		printf("\nCompare file sync methods using one %dkB write:\n", XLOG_BLCKSZ_K);
 	else
 		printf("\nCompare file sync methods using two %dkB writes:\n", XLOG_BLCKSZ_K);
-	printf("(in wal_sync_method preference order, except fdatasync\n");
-	printf("is Linux's default)\n");
+	printf("(in wal_sync_method preference order, except fdatasync is Linux's default)\n");
 
 	/*
 	 * Test open_datasync if available
@@ -398,8 +397,8 @@ static void
 test_open_syncs(void)
 {
 	printf("\nCompare open_sync with different write sizes:\n");
-	printf("(This is designed to compare the cost of writing 16kB\n");
-	printf("in different write open_sync sizes.)\n");
+	printf("(This is designed to compare the cost of writing 16kB in different write\n"
+		   "open_sync sizes.)\n");
 
 	test_open_sync(" 1 * 16kB open_sync write", 16);
 	test_open_sync(" 2 *  8kB open_sync writes", 8);
@@ -459,8 +458,8 @@ test_file_descriptor_sync(void)
 	 * on platforms which support it.
 	 */
 	printf("\nTest if fsync on non-write file descriptor is honored:\n");
-	printf("(If the times are similar, fsync() can sync data written\n");
-	printf("on a different descriptor.)\n");
+	printf("(If the times are similar, fsync() can sync data written on a different\n"
+		   "descriptor.)\n");
 
 	/*
 	 * first write, fsync and close, which is the normal behavior without
@@ -524,7 +523,7 @@ test_non_sync(void)
 	/*
 	 * Test a simple write without fsync
 	 */
-	printf("\nNon-Sync'ed %dkB writes:\n", XLOG_BLCKSZ_K);
+	printf("\nNon-sync'ed %dkB writes:\n", XLOG_BLCKSZ_K);
 	printf(LABEL_FORMAT, "write");
 	fflush(stdout);
 
-- 
GitLab