/************************************************************************* * * * SignServer: The OpenSource Automated Signing Server * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.signserver.client.cli.performance; import java.io.*; import java.util.ArrayList; import java.util.List; import org.signserver.cli.spi.AbstractCommand; import org.signserver.cli.spi.CommandFailureException; import org.signserver.cli.spi.IllegalCommandArgumentsException; /** * Used both for loading a server during performance testing and postprocessing resulting CSV statistics. * * @version $Id: PDFPerformanceCommand.java 2301 2012-04-02 11:53:49Z netmackan $ */ public class PDFPerformanceCommand extends AbstractCommand { private final static String[] testModules = {PerformanceTestPDFServlet.class.getName() }; private long totalInvocations; private String baseURLString = null; public String getDescription() { return "Run PDF performance testing"; } @Override public String getUsages() { return "Parameters: \n"; } @Override public int execute(String[] args) throws IllegalCommandArgumentsException, CommandFailureException { if (args.length==0) { throw new IllegalCommandArgumentsException("Wrong number of arguments"); } if (args[0].equalsIgnoreCase("test")) { runTest(args); } else { postProcessRawData(args); } return 0; } /** * Perform postprocessing for all supported modules */ private void postProcessRawData(String[] args) { String statisticsDirectory = null; File dir = null; final String info = "Parameters: