Search in sources :

Example 1 with QueryData

use of com.servoy.j2db.dataprocessing.QueryData in project servoy-client by Servoy.

the class ProfileDataServer method performQuery.

@Override
public IDataSet[] performQuery(String client_id, String server_name, String transaction_id, QueryData[] array) throws ServoyException, RemoteException {
    long startTime = System.currentTimeMillis();
    try {
        return super.performQuery(client_id, server_name, transaction_id, array);
    } finally {
        int counter = 0;
        long timePerQuery = (System.currentTimeMillis() - startTime) / array.length;
        for (QueryData queryData : array) {
            long time = System.currentTimeMillis() - timePerQuery;
            QuerySet set = getSQLQuerySet(server_name, queryData.getSqlSelect(), queryData.getFilters(), queryData.getStartRow(), queryData.getRowsToRetrieve(), false, false);
            informListeners(PerformanceTiming.getTypeString(queryData.getType()) + " Combined Query[" + (counter++) + '/' + array.length + ']', server_name, set.getSelect().getSql(), transaction_id, time, set.getSelect().getParameters());
        }
    }
}
Also used : QueryData(com.servoy.j2db.dataprocessing.QueryData) QuerySet(com.servoy.j2db.persistence.QuerySet)

Aggregations

QueryData (com.servoy.j2db.dataprocessing.QueryData)1 QuerySet (com.servoy.j2db.persistence.QuerySet)1