Skip to content

Commit

Permalink
decrease log severity
Browse files Browse the repository at this point in the history
  • Loading branch information
muraty committed Nov 25, 2024
1 parent 99cae5b commit b136dc2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func getHostname() string {

// Run starts the http server and begins listening for HTTP requests.
func (a *Agent) Run() error {
log.Infof("Running server on %s \n", a.Config.ListenAddress)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion agent/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (a *Agent) doPoll(ctx context.Context) error {

a.SetConns(conns)

log.Infof("Updated connections: %d", len(conns))
log.Debugf("Updated connections: %d", len(conns))
return nil
}

Expand Down
18 changes: 9 additions & 9 deletions server/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (f *Fetcher) getAgentProcess(ctx context.Context, wg *sync.WaitGroup, rp *R

// addProxyConns adds TCPProxy connection info if TCPProxy is enabled.
func addProxyConns(rps []*RawProcess, conns []*TCPProxyConn) {
log.Infoln("Adding tcpproxy conns...")
log.Debugln("Adding tcpproxy conns...")
for _, rp := range rps {
conn := findTCPProxyConn(rp.AgentAddress(), conns)
if conn != nil {
Expand All @@ -131,7 +131,7 @@ func addProxyConns(rps []*RawProcess, conns []*TCPProxyConn) {

// createRawProcesses creates raw process and inserts given param.
func createRawProcesses(rows []*MysqlRow) []*RawProcess {
log.Infoln("Combining mysql and tcpproxy results...")
log.Debugln("Creating raw processes...")
var rps []*RawProcess
for _, row := range rows {
rp := &RawProcess{MysqlRow: row}
Expand All @@ -142,14 +142,14 @@ func createRawProcesses(rows []*MysqlRow) []*RawProcess {

// FetchAll fetches and creates processes from resources to agents
func (f *Fetcher) FetchAll(ctx context.Context) ([]*RawProcess, error) {
log.Infoln("Fetching resources...")
log.Debugln("Fetching resources...")

log.Infoln("Fetching mysql rows...")
log.Debugln("Fetching mysql rows...")
rows, err := f.fetchMysql(ctx)
if err != nil {
return nil, err
}
log.Infof("Got %d mysql rows \n", len(rows))
log.Debugln("Got %d mysql rows \n", len(rows))

rps := createRawProcesses(rows)

Expand All @@ -158,16 +158,16 @@ func (f *Fetcher) FetchAll(ctx context.Context) ([]*RawProcess, error) {
rp.TCPProxyEnabled = true
}

log.Infoln("Fetching tcpproxy conns...")
log.Debugln("Fetching tcpproxy conns...")
tps, err := f.fetchTcpProxy(ctx)
if err != nil {
return nil, err
}
log.Infof("Got %d tcpproxy conns \n", len(tps))
log.Debugf("Got %d tcpproxy conns \n", len(tps))
addProxyConns(rps, tps)
}

log.Infof("Fetching %d agents...\n", len(rps))
log.Debugf("Fetching %d agents...\n", len(rps))
f.fetchAgents(ctx, rps)

log.Debugf("%d raw processes are generated \n", len(rps))
Expand Down Expand Up @@ -246,7 +246,7 @@ func (f *Fetcher) fetchAgents(ctx context.Context, rps []*RawProcess) {
log.Errorf("fetch agents operation timed out: %s", ctx.Err())
return
case <-done:
log.Infoln("All agents are visited.")
log.Debugln("All agents are visited.")
return
}
}
1 change: 0 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func (s *Server) ConvertProcesses(rps []*RawProcess) []KimoProcess {

// NewServer creates an returns a new *Server
func NewServer(cfg *config.ServerConfig) *Server {
log.Infoln("Creating a new server...")
s := &Server{
Config: cfg,
PrometheusMetric: NewPrometheusMetric(cfg.Metric.CmdlinePatterns),
Expand Down

0 comments on commit b136dc2

Please sign in to comment.