@Override
    public ClientUsagePerApiBean getClientUsagePerApi(String organizationId, String clientId, String version,
            DateTime from, DateTime to) {
        try {
            QueryRunner run = new QueryRunner(ds);
            String sql = "SELECT api_id, count(*) FROM gw_requests WHERE client_org_id = ? AND client_id = ? AND client_version = ? AND rstart >= ? AND rstart < ? GROUP BY api_id"; //$NON-NLS-1$
            ResultSetHandler<ClientUsagePerApiBean> handler = new ClientUsagePerApiHandler();
            return run.query(sql, handler, organizationId, clientId, version, from.getMillis(), to.getMillis());
        } catch (SQLException e) {
            e.printStackTrace();
            return new ClientUsagePerApiBean();
        }
    }
@see io.apiman.manager.api.core.IMetricsAccessor#getClientUsagePerApi(java.lang.String, java.lang.String, java.lang.String, org.joda.time.DateTime, org.joda.time.DateTime)
manager/api/jdbc/src/main/java/io/apiman/manager/api/jdbc/JdbcMetricsAccessor.java