Repository navigation
Expand file tree
/
Copy pathmain.go
More file actions
62 lines (50 loc) · 1.37 KB
/
Copy pathmain.go
File metadata and controls
62 lines (50 loc) · 1.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"log"
"time"
"drexel.edu/cci/sysmonitor-tool/container"
"drexel.edu/cci/sysmonitor-tool/monitors"
"drexel.edu/cci/sysmonitor-tool/monitors/types"
"drexel.edu/cci/sysmonitor-tool/utils"
)
// Global variables for Flags
var (
VerboseFlag bool = false //dont be verbose
InclMonitorDataFlag bool = false //dont include monitor data
FilterByPidFlag int = 0 //0 means get all pids in system
IntervalTimeFlag time.Duration = 5 * time.Second //5 seconds default
NumIntervalsFlag int = 100 //run for 100 intervals as a default
RunDurationFlag time.Duration = time.Minute //runtime duration
)
func testDurationLoop() {
finishTime := time.Now().Add(RunDurationFlag)
ticker := time.NewTicker(IntervalTimeFlag)
for range ticker.C {
log.Println("Tick")
if time.Now().After(finishTime) {
break
}
}
}
func main() {
utils.SetupFlags()
cm := container.New()
defer cm.Close()
/*
scm := syscalls.NewWithContainerManager(&cm)
scm.Start()
scm.Close()
*/
/*
ss := sysstream.NewWithContainerManager(&cm)
ss.Start()
ss.Close()
*/
//Newly refactored system interface
ss1, err := monitors.NewWithContainerManager(&cm, types.SysStream)
if err != nil {
log.Fatalf("Error creating monitor from factory interface")
}
ss1.Start()
ss1.Close()
}