func Run(interval time.Duration, flushInterval time.Duration, db *db.DB) error {
	if interval > flushInterval {
		return xerrors.Errorf(
			"polling interval (%s) must not exceed flush interval (%s)",
			interval, flushInterval)
	}
	buffer := make(flowBuffer, flushInterval/interval+1)
	defer close(buffer)
	go watch(interval, buffer, db)
	go flusher(flushInterval, buffer, db)
	return agent.Wait(db)
}
Run starts agent.
package polling
import (
	"time"
	"github.com/yuuki/shawk/agent"
	"github.com/yuuki/shawk/db"
	"github.com/yuuki/shawk/logging"
	"github.com/yuuki/shawk/probe"
	"github.com/yuuki/shawk/probe/netlink"
	"golang.org/x/xerrors"
)
type flowBuffer chan []*probe.HostFlow
var logger = logging.New("agent/polling")