Whamcloud - gitweb
LU-1365 tests: createmany outputs stat after 2 seconds 56/33756/6
authorArtem Blagodarenko <c17828@cray.com>
Wed, 28 Nov 2018 19:55:30 +0000 (22:55 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Feb 2019 03:22:21 +0000 (03:22 +0000)
Createmany outputs current operation information every 10 seconds or
every 10k operations. For fast  devices, this overflows screen.

Change createmany to output every 10k operations or every 10 seconds
in case it has not been finished after 2 seconds of execution.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Artem Blagodarenko <c17828@cray.com>
Change-Id: I8bebff021e53e2338d372336a9ed14da6a3b45c7
Reviewed-on: https://review.whamcloud.com/33756
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
lustre/tests/createmany.c

index 1e68ce6..b891102 100644 (file)
@@ -171,6 +171,8 @@ int main(int argc, char ** argv)
 
        for (i = 0, start = last_t = now(), end += start;
             i < count && now() < end; i++, begin++) {
 
        for (i = 0, start = last_t = now(), end += start;
             i < count && now() < end; i++, begin++) {
+               double tmp;
+
                filename = get_file_name(fmt, begin, has_fmt_spec);
                if (do_open) {
                        int fd = open(filename, O_CREAT|O_RDWR, 0644);
                filename = get_file_name(fmt, begin, has_fmt_spec);
                if (do_open) {
                        int fd = open(filename, O_CREAT|O_RDWR, 0644);
@@ -223,9 +225,9 @@ int main(int argc, char ** argv)
                        }
                }
 
                        }
                }
 
-               if ((i != 0 && (i % 10000) == 0) || now() - last_t >= 10.0) {
-                       double tmp = now();
-
+               tmp = now();
+               if (tmp - last_t >= 10.0 ||
+                   (tmp - last_t > 2.0 && (i % 10000) == 0)) {
                        printf(" - %s%s %ld (time %.2f total %.2f last %.2f)"
                               "\n",
                               do_open ? do_keep ? "open/keep" : "open/close" :
                        printf(" - %s%s %ld (time %.2f total %.2f last %.2f)"
                               "\n",
                               do_open ? do_keep ? "open/keep" : "open/close" :