@@ -2005,6 +2005,8 @@ void Statistics::printPhaseResultsAsJSON(const PhaseResults& phaseResults)
20052005{
20062006 bpt::ptree ptree;
20072007
2008+ bpt::ptree configSubtree;
2009+
20082010 bpt::ptree firstDoneSubtree;
20092011 bpt::ptree firstDoneSubtreeReadMix;
20102012 bpt::ptree lastDoneSubtree;
@@ -2045,13 +2047,83 @@ void Statistics::printPhaseResultsAsJSON(const PhaseResults& phaseResults)
20452047
20462048 ptree.put (" iso_start_date" , dateStream.str () );
20472049
2048- // elapsed time
2050+ // config subtree...
20492051
2050- firstDoneSubtree.put (" elapsed_time_ms" , phaseResults.firstFinishUSec / 1000 );
2051- lastDoneSubtree.put (" elapsed_time_ms" , phaseResults.lastFinishUSec / 1000 );
2052+ configSubtree.put (" path_type" , TranslatorTk::benchPathTypeToStr (
2053+ progArgs.getBenchPathType (), &progArgs) );
2054+
2055+ configSubtree.put (" paths" , progArgs.getBenchPaths ().size () );
2056+
2057+ configSubtree.put (" hosts" , progArgs.getHostsVec ().empty () ?
2058+ 1 : progArgs.getHostsVec ().size () );
2059+
2060+ configSubtree.put (" threads" , progArgs.getNumThreads () );
2061+
2062+ if (progArgs.getBenchPathType () == BenchPathType_DIR)
2063+ {
2064+ if (progArgs.getTreeFilePath ().empty () )
2065+ {
2066+ configSubtree.put (" dirs" , progArgs.getNumDirs () );
2067+ configSubtree.put (" files" , progArgs.getNumFiles () );
2068+ }
2069+ else
2070+ { // custom tree
2071+ configSubtree.put (" custom_tree_dirs" ,
2072+ progArgs.getCustomTreeDirs ().getNumPaths () );
2073+ configSubtree.put (" custom_tree_files_shared" ,
2074+ progArgs.getCustomTreeFilesShared ().getNumPaths () );
2075+ configSubtree.put (" files_not_shared" ,
2076+ progArgs.getCustomTreeFilesNonShared ().getNumPaths () );
2077+ }
2078+ }
2079+
2080+ configSubtree.put (" file_size" , progArgs.getFileSize () );
2081+ configSubtree.put (" block_size" , progArgs.getBlockSize () );
2082+ configSubtree.put (" direct_io" , progArgs.getUseDirectIO () );
2083+ configSubtree.put (" random_offsets" , progArgs.getUseRandomOffsets () );
2084+
2085+ if (progArgs.getUseRandomOffsets () )
2086+ configSubtree.put (" random_aligned" , !progArgs.getUseRandomUnaligned () );
2087+
2088+ configSubtree.put (" io_depth" , progArgs.getIODepth () );
2089+
2090+ if (!progArgs.getHostsVec ().empty () )
2091+ configSubtree.put (" shared_service_paths" , progArgs.getIsServicePathShared () );
2092+
2093+ if ( progArgs.getS3EndpointsVec ().empty () &&
2094+ (progArgs.getBenchPathType () != BenchPathType_BLOCKDEV) )
2095+ configSubtree.put (" truncate_files" , progArgs.getDoTruncate () );
2096+
2097+ // elbencho version
2098+
2099+ configSubtree.put (" version" , EXE_VERSION );
2100+
2101+ // command line
2102+
2103+ std::ostringstream cmdStream;
2104+ std::string cmdString;
2105+
2106+ for (int i=0 ; i < progArgs.getProgArgCount (); i++)
2107+ {
2108+ if (!strcmp (progArgs.getProgArgVec ()[i], " --" ARG_S3ACCESSSECRET_LONG ) )
2109+ { // skip over s3 secret
2110+ i += 1 ;
2111+ continue ;
2112+ }
20522113
2114+ cmdStream << " \" " << progArgs.getProgArgVec ()[i] << " \" " ;
2115+ }
2116+
2117+ cmdString = cmdStream.str ();
2118+ std::replace (cmdString.begin (), cmdString.end (), ' ,' , ' ' ); // replace all commas with spaces
20532119
2054- // fist done subtree
2120+ configSubtree.put (" command" , cmdString);
2121+
2122+
2123+ // elasped time (first done & last done)
2124+
2125+ firstDoneSubtree.put (" elapsed_time_ms" , phaseResults.firstFinishUSec / 1000 );
2126+ lastDoneSubtree.put (" elapsed_time_ms" , phaseResults.lastFinishUSec / 1000 );
20552127
20562128 // lambda to fill first done & last done subtrees with per-second values
20572129 std::function addPerSecResultsToSubtree = [](const LiveOps& opsTotal,
@@ -2118,7 +2190,7 @@ void Statistics::printPhaseResultsAsJSON(const PhaseResults& phaseResults)
21182190 addTotalResultsToSubtree (phaseResults.opsTotalReadMix ,
21192191 phaseResults.opsTotalReadMix , lastDoneSubtreeReadMix);
21202192
2121- // copy rwmix read subtrees into first & last done subtrees
2193+ // copy rwmix read subtrees into first & last done subtrees
21222194
21232195 if (firstDoneSubtreeReadMix.size () )
21242196 firstDoneSubtree.put_child (" rwmix_read" , firstDoneSubtreeReadMix);
@@ -2188,35 +2260,13 @@ void Statistics::printPhaseResultsAsJSON(const PhaseResults& phaseResults)
21882260 if (lastDoneLatencySubtree.size () )
21892261 lastDoneSubtree.put_child (" latency" , lastDoneLatencySubtree);
21902262
2191- // copy first done & last done subtrees into main tree
21922263
2264+ // copy first level subtrees into main tree
2265+
2266+ ptree.put_child (" config" , configSubtree);
21932267 ptree.put_child (" first_done" , firstDoneSubtree);
21942268 ptree.put_child (" last_done" , lastDoneSubtree);
21952269
2196- // elbencho version
2197-
2198- ptree.put (" version" , EXE_VERSION );
2199-
2200- // command line
2201-
2202- std::ostringstream cmdStream;
2203- std::string cmdString;
2204-
2205- for (int i=0 ; i < progArgs.getProgArgCount (); i++)
2206- {
2207- if (!strcmp (progArgs.getProgArgVec ()[i], " --" ARG_S3ACCESSSECRET_LONG ) )
2208- { // skip over s3 secret
2209- i += 1 ;
2210- continue ;
2211- }
2212-
2213- cmdStream << " \" " << progArgs.getProgArgVec ()[i] << " \" " ;
2214- }
2215-
2216- cmdString = cmdStream.str ();
2217- std::replace (cmdString.begin (), cmdString.end (), ' ,' , ' ' ); // replace all commas with spaces
2218-
2219- ptree.put (" command" , cmdString);
22202270
22212271 // print json
22222272
0 commit comments