Search in sources :

Example 11 with TimeSeriesChart

use of org.ff4j.audit.chart.TimeSeriesChart in project ff4j by ff4j.

the class EventRepositorySpringJdbc method getFeatureUsageHistory.

/**
 * {@inheritDoc}
 */
@Override
public TimeSeriesChart getFeatureUsageHistory(EventQueryDefinition query, TimeUnit units) {
    // Create the interval depending on units
    TimeSeriesChart tsc = new TimeSeriesChart(query.getFrom(), query.getTo(), units);
    // Search All events
    Iterator<Event> iterEvent = searchFeatureUsageEvents(query).iterator();
    // Dispatch events into time slots
    while (iterEvent.hasNext()) {
        tsc.addEvent(iterEvent.next());
    }
    return tsc;
}
Also used : TimeSeriesChart(org.ff4j.audit.chart.TimeSeriesChart) Event(org.ff4j.audit.Event)

Aggregations

TimeSeriesChart (org.ff4j.audit.chart.TimeSeriesChart)11 Event (org.ff4j.audit.Event)8 EventQueryDefinition (org.ff4j.audit.EventQueryDefinition)3 Test (org.junit.Test)3 MutableHitCount (org.ff4j.audit.MutableHitCount)2 Serie (org.ff4j.audit.chart.Serie)2 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 EventBuilder (org.ff4j.audit.EventBuilder)1 EventSeries (org.ff4j.audit.EventSeries)1