public static void create ( final Path input , final Template template , final Params < ? > params , final Path output , final SampleSummary summary , final SampleSummary ... summaries ) throws IOException { final Stream < SampleSummary > summaryStream = Stream . concat ( Stream . of ( summary ) , Stream . of ( summaries ) ) ; summaryStream . forEach ( s -> { if ( params . size ( ) != s . parameterCount ( ) ) { throw new IllegalArgumentException ( format ( "Parameters have different size: %d" , params . size ( ) ) ) ; } } ) ; final Path templatePath = tempPath ( ) ; try { IO . write ( template . content ( ) , templatePath ) ; final Path dataPath = tempPath ( ) ; try { final String data = IntStream . range ( 0 , params . size ( ) ) . mapToObj ( i -> toLineString ( i , params , summary , summaries ) ) . collect ( Collectors . joining ( "\n" ) ) ; IO . write ( data , dataPath ) ; final Gnuplot gnuplot = new Gnuplot ( templatePath ) ; gnuplot . setEnv ( params ( input ) ) ; gnuplot . create ( dataPath , output ) ; } finally { deleteIfExists ( dataPath ) ; } } finally { deleteIfExists ( templatePath ) ; } }
Create a performance diagram .