func (m *Monitor) Init(nsp model.NSPInterface) error {
	m.Nsp = nsp
	m.wg = nsp.GetWaitGroup()
	m.config = nsp.GetConfig()
	m.collection = nsp.GetCollection()
	// Create RTNetLink connection and create Qdisc if
	// the monitor requires it
	if m.Ifindex != 0 {
		if err := m.setupRTNetLink(); err != nil {
			return err
		}
		if err := m.createQdisc(); err != nil {
			return err
		}
	}
	// Init probes
	for _, p := range m.Probes {
		if err := p.Init(m); err != nil {
			return err
		}
	}
	return nil
}
// Init - Initializes the monitor
Initializes the monitor
// Init - Initializes the monitor
func (m *Monitor) Init(nsp model.NSPInterface) error {
	m.Nsp = nsp
	m.wg = nsp.GetWaitGroup()
	m.config = nsp.GetConfig()
	m.collection = nsp.GetCollection()
	if m.Ifindex != 0 {
		if err := m.setupRTNetLink(); err != nil {
			return err
		}
		if err := m.createQdisc(); err != nil {
			return err
		}
	}
	for _, p := range m.Probes {
		if err := p.Init(m); err != nil {
			return err
		}
	}
	return nil
}
func ( m * Monitor ) Init ( nsp model . NSPInterface ) error { m . Nsp = nsp m . wg = nsp . GetWaitGroup ( ) m . config = nsp . GetConfig ( ) m . collection = nsp . GetCollection ( ) if m . Ifindex != 0 { if err := m . setupRTNetLink ( ) ; err != nil { return err } if err := m . createQdisc ( ) ; err != nil { return err } } for _ , p := range m . Probes { if err := p . Init ( m ) ; err != nil { return err } } return nil }
Initializes the monitor
Initializes the monitor
// Create RTNetLink connection and create Qdisc if // the monitor requires it // Init probes