/ Check-in [b0f58d24]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In kvtest.c: do not show the --cache-size setting on fopen() runs. Show progress for the (potentially slow) "export" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | kvtest
Files: files | file ages | folders
SHA1:b0f58d2470e08b9c217afd19fcfde3e6d1007d1d
User & Date: drh 2016-12-29 15:26:50
Context
2016-12-29
16:18
Fix kvtest.c so that it compiles using MSVC. check-in: e2bbeae7 user: drh tags: kvtest
15:26
In kvtest.c: do not show the --cache-size setting on fopen() runs. Show progress for the (potentially slow) "export" command. check-in: b0f58d24 user: drh tags: kvtest
14:44
Improvements to the kvtest.c utility. Added the --cache-size option. Additional reporting of version and settings at the end of "./kvtest run". check-in: f6fcac6a user: drh tags: kvtest
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/kvtest.c.

   201    201     z = (const char*)sqlite3_value_blob(argv[1]);
   202    202     if( z==0 ){
   203    203       rc = 0;
   204    204     }else{
   205    205       rc = fwrite(z, 1, sqlite3_value_bytes(argv[1]), out);
   206    206     }
   207    207     fclose(out);
          208  +  printf("\r%s   ", zFile); fflush(stdout);
   208    209     sqlite3_result_int64(context, rc);
   209    210   }
   210    211   
   211    212   /*
   212    213   ** Export the kv table to individual files in the filesystem
   213    214   */
   214    215   static int exportMain(int argc, char **argv){
................................................................................
   237    238       "SELECT writefile(printf('%s/%%06d',k),v) FROM kv;",
   238    239       zDir
   239    240     );
   240    241     rc = sqlite3_exec(db, zSql, 0, 0, &zErrMsg);
   241    242     if( rc ) fatalError("database create failed: %s", zErrMsg);
   242    243     sqlite3_free(zSql);
   243    244     sqlite3_close(db);
          245  +  printf("\n");
   244    246     return 0;
   245    247   }
   246    248   
   247    249   /*
   248    250   ** Read the content of file zName into memory obtained from sqlite3_malloc64()
   249    251   ** and return a pointer to the buffer. The caller is responsible for freeing 
   250    252   ** the memory. 
................................................................................
   476    478     tmElapsed = timeOfDay() - tmStart;
   477    479     if( nExtra ){
   478    480       printf("%d cycles due to %d misses\n", nCount, nExtra);
   479    481     }
   480    482     if( eType==PATH_DB ){
   481    483       printf("SQLite version: %s\n", sqlite3_libversion());
   482    484     }
   483         -  printf("--count %d --max-id %d --cache-size %d", nCount-nExtra, iMax, iCache);
          485  +  printf("--count %d --max-id %d", nCount-nExtra, iMax);
          486  +  if( eType==PATH_DB ){
          487  +    printf(" --cache-size %d", iCache);
          488  +  }
   484    489     switch( eOrder ){
   485    490       case ORDER_RANDOM:  printf(" --random\n");  break;
   486    491       case ORDER_DESC:    printf(" --desc\n");    break;
   487    492       default:            printf(" --asc\n");     break;
   488    493     }
   489    494     if( iPagesize ) printf("Database page size: %d\n", iPagesize);
   490    495     printf("Total elapsed time: %.3f\n", tmElapsed/1000.0);