Created
February 9, 2017 18:37
-
-
Save alinVD/f755dbbceeaa3f78cd474aeacb1fa78a to your computer and use it in GitHub Desktop.
Compute overall usage of Netflow Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # RTime: 282s | |
| # Tuples: | |
| ## This query shows the total activity, measured in bytes transmitted in either | |
| ## direction. The daily profiles are charted at the 15 minute resolution. | |
| library(gtStats) | |
| ## The bounds for the data that is being considered. | |
| lower <- as.POSIXct("2012-04-06 00:00:00", "GMT") | |
| upper <- as.POSIXct("2012-04-16 23:59:59", "GMT") | |
| ## The data is filtered to only include data from April. | |
| flow <- Load(NetFlow)[.(lower) <= StartTime && StartTime <= .(upper)] | |
| daily <- GroupBy(flow, | |
| c(Date = Date(StartTime), | |
| Hour = StartTime$Hour(), | |
| Quarter = StartTime$Minute() %/% 15), | |
| Bytes = Sum(abs(TotBytes)), | |
| Count = Count()) | |
| overall <- GroupBy(daily, Date, | |
| LineChart(c(4 * Hour + Quarter, Bytes), Chart, 96), | |
| Sum(Count)) | |
| ordered <- OrderBy(overall, asc(Date)) | |
| result <- View(ordered) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment