@@ -3,8 +3,8 @@ package model
33import "time"
44
55type Container struct {
6- ID string
7- Name string
6+ ID string `json:"id"`
7+ Name string `json:"name"`
88
99 SystemCalls
1010
@@ -22,62 +22,57 @@ func NewContainer(id, name string) *Container {
2222
2323type SystemCalls struct {
2424 // map system call name to SystemCall
25- IndividualCalls map [string ]* SystemCall
26- TotalCalls int64
25+ IndividualCalls map [string ]* SystemCall `json:"individual_calls"`
26+ TotalCalls int64 `json:"total_calls"`
2727}
2828
2929type FileSystem struct {
3030 // map file name to file
31- AccessedFiles map [string ]* File
31+ AccessedFiles map [string ]* File `json:"accessed_files"`
3232 // io calls whose latency is bigger than 1ms
33- IOCalls1 []* IOCall
33+ IOCalls1 []* IOCall `json:"io_calls_more_than_1ms"`
3434 // io calls whose latency is bigger than 10ms
35- IOCalls10 []* IOCall
35+ IOCalls10 []* IOCall `json:"io_calls_more_than_10ms"`
3636 // io calls whose latency is bigger than 100ms
37- IOCalls100 []* IOCall
38- TotalReadIn int64
39- TotalWriteOut int64
37+ IOCalls100 []* IOCall `json:"io_calls_more_than_100ms"`
38+ TotalReadIn int64 `json:"file_total_read_in"`
39+ TotalWriteOut int64 `json:"file_total_write_out"`
4040}
4141
4242type Network struct {
43- ActiveConnections map [ConnectionMeta ]* Connection `json:"-"`
44- FlattenConnections [] * FlattenConnection `json:"active_connections "`
45- TotalReadIn , TotalWriteOut int64
43+ ActiveConnections map [ConnectionMeta ]* Connection `json:"-"`
44+ TotalReadIn int64 `json:"net_total_read_in "`
45+ TotalWriteOut int64 `json:"net_total_wirte_out"`
4646}
4747
4848type SystemCall struct {
4949 Name string `json:"-"`
5050 // total number of times it is invoked
51- Calls int64
52- TotalTime time.Duration
51+ Calls int64 `json:"calls"`
52+ TotalTime time.Duration `json:"total_time"`
5353}
5454
5555type File struct {
5656 Name string `json:"-"`
57- WriteOut int64
58- ReadIn int64
57+ WriteOut int64 `json:"write_out"`
58+ ReadIn int64 `json:"read_in"`
5959}
6060
6161type Connection struct {
6262 // ipv4 or ipv6
63- Type string
64- WriteOut int64
65- ReadIn int64
63+ Type string `json:"type"`
64+ WriteOut int64 `json:"write_out"`
65+ ReadIn int64 `json:"read_in"`
6666}
6767
6868type ConnectionMeta struct {
69- SourceIP string
70- DestIP string
71- SourcePort int
72- DestPort int
73- }
74-
75- type FlattenConnection struct {
76- ConnectionMeta
77- Connection
69+ SourceIP string `json:"source_ip"`
70+ DestIP string `json:"dest_ip"`
71+ SourcePort int `json:"source_port"`
72+ DestPort int `json:"dest_port"`
7873}
7974
8075type IOCall struct {
81- FileName string
82- Latency time.Duration
76+ FileName string `json:"file_name"`
77+ Latency time.Duration `json:"latency"`
8378}
0 commit comments