org.graylog2.restclient.models.api.results.DateHistogramResult Maven / Gradle / Ivy
The newest version!
/**
* This file is part of Graylog.
*
* Graylog is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Graylog is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Graylog. If not, see .
*/
package org.graylog2.restclient.models.api.results;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.graylog2.restclient.lib.timeranges.AbsoluteRange;
import org.graylog2.restclient.lib.timeranges.RelativeRange;
import org.graylog2.restclient.lib.timeranges.TimeRange;
import java.util.List;
import java.util.Map;
public class DateHistogramResult {
private final String originalQuery;
private final Map results;
private final AbsoluteRange histogramBoundaries;
private final TimeRange timeRange;
private final String interval;
private final int tookMs;
public DateHistogramResult(String originalQuery,
int tookMs,
String interval,
Map results,
AbsoluteRange boundaries,
TimeRange timeRange) {
this.originalQuery = originalQuery;
this.results = results;
this.interval = interval;
this.tookMs = tookMs;
this.histogramBoundaries = boundaries;
this.timeRange = timeRange;
}
public Map getResults() {
return results;
}
/**
* [{ x: -1893456000, y: 92228531 }, { x: -1577923200, y: 106021568 }]
*
* @return A JSON string representation of the result, suitable for Rickshaw data graphing.
*/
@Deprecated
public List