Package org.graylog2.system.traffic
Class TrafficCounterService
java.lang.Object
org.graylog2.system.traffic.TrafficCounterService
- All Implemented Interfaces:
TrafficUpdater
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclusterTrafficOfLastDays(org.joda.time.Duration daysToIncludeDuration, TrafficCounterService.Interval interval) Method included for backwards compatibility in pre-5.0 Graylog versions.clusterTrafficOfLastDays(org.joda.time.Duration daysToIncludeDuration, TrafficCounterService.Interval interval, boolean includeToday) Queries traffic for the specified duration.static org.bson.conversions.BsoncreateQuery(org.joda.time.DateTime to, org.joda.time.DateTime from) createTrafficHistograms(org.joda.time.Duration daysToIncludeDuration, boolean includeToday) static org.bson.conversions.Bsonstatic longsumTraffic(Map<String, Long> sumTraffic) voidupdateTraffic(org.joda.time.DateTime observationTime, NodeId nodeId, long inLastMinute, long outLastMinute, long decodedLastMinute)
-
Constructor Details
-
TrafficCounterService
-
-
Method Details
-
updateTraffic
public void updateTraffic(org.joda.time.DateTime observationTime, NodeId nodeId, long inLastMinute, long outLastMinute, long decodedLastMinute) - Specified by:
updateTrafficin interfaceTrafficUpdater
-
incUpdate
-
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) whenincludeTodayfalse, 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
-