class QueryMetricsBean {

    @GET
    @Path("/summary")
    @Interceptors(ResponseInterceptor.class)
    public QueryMetricsSummaryResponse getTotalQueriesSummaryCounts(
                    @QueryParam("begin") @DateFormat(defaultTime = "000000", defaultMillisec = "000") Date begin, @QueryParam("end") @DateFormat(
                                    defaultTime = "235959", defaultMillisec = "999") Date end) {
        
        if (null == begin) {
            // midnight of ninety days ago
            Calendar ninetyDaysAgo = Calendar.getInstance(DateUtils.UTC_TIME_ZONE);
            ninetyDaysAgo.add(Calendar.DATE, -90);
            begin = DateUtils.truncate(ninetyDaysAgo, Calendar.DATE).getTime();
        } else {
            begin = DateUtils.truncate(begin, Calendar.SECOND);
        }
        if (null == end) {
            end = new Date();
        } else {
            end = DateUtils.truncate(end, Calendar.SECOND);
        }
        DatawavePrincipal dp = getPrincipal();
        return queryHandler.getTotalQueriesSummaryCounts(begin, end, dp);
    }

}