Class TrafficCounterService

java.lang.Object
org.graylog2.system.traffic.TrafficCounterService
All Implemented Interfaces:
TrafficUpdater

public class TrafficCounterService extends Object implements TrafficUpdater
  • Constructor Details

    • TrafficCounterService

      @Inject public TrafficCounterService(MongoCollections mongoCollections)
  • Method Details

    • updateTraffic

      public void updateTraffic(org.joda.time.DateTime observationTime, NodeId nodeId, long inLastMinute, long outLastMinute, long decodedLastMinute)
      Specified by:
      updateTraffic in interface TrafficUpdater
    • incUpdate

      public static org.bson.conversions.Bson incUpdate(String fieldInput, String escapedNodeId, long inLastMinute)
    • clusterTrafficOfLastDays

      public TrafficCounterService.TrafficHistogram clusterTrafficOfLastDays(org.joda.time.Duration daysToIncludeDuration, TrafficCounterService.Interval interval)
      Method included for backwards compatibility in pre-5.0 Graylog versions.
    • clusterTrafficOfLastDays

      public TrafficCounterService.TrafficHistogram clusterTrafficOfLastDays(org.joda.time.Duration daysToIncludeDuration, TrafficCounterService.Interval interval, boolean includeToday)
      Queries traffic for the specified duration.
      The from-date is considered to be the start of the day that the duration intersects with in the past. For example, if a duration of 1.5 days is specified, then traffic starting from the beginning of two days ago will be returned.
      The to-date is considered to be the current date/time (now) when includeToday false, otherwise then the end of the previous day will be used.
    • createTrafficHistograms

      public static TrafficCounterService.TrafficHistograms createTrafficHistograms(org.joda.time.Duration daysToIncludeDuration, boolean includeToday)
    • createQuery

      public static org.bson.conversions.Bson createQuery(org.joda.time.DateTime to, org.joda.time.DateTime from)
    • sumTraffic

      public static long sumTraffic(Map<String,Long> sumTraffic)