-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.groovy
More file actions
30 lines (21 loc) · 721 Bytes
/
Copy pathtest.groovy
File metadata and controls
30 lines (21 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import logvisualizer.RegExEvent
import logvisualizer.Event
import logvisualizer.TimeLineVisualizer
import logvisualizer.HistogramVisualizer
import logvisualizer.RegExEvent
Event EVENT1 = new RegExEvent("Event 1", ~/Event 1/)
Event EVENT2 = new RegExEvent("Event 2", ~/Event 2/)
Event ERROR = new RegExEvent("Error", ~/ERROR/)
def logFile = new File("test.log");
logFile.withInputStream {InputStream stream ->
def visualizer = new TimeLineVisualizer([
EVENT1,
EVENT2,
ERROR
]);
visualizer.visualize(stream)
}
logFile.withInputStream {InputStream stream ->
def visualizer = new HistogramVisualizer(EVENT2, HistogramVisualizer.HOUR_OF_DAY_BINS)
visualizer.visualize(stream)
}