Skip to content

Commit

Permalink
PMM-12375 remove Stats from agent.proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Sep 16, 2023
1 parent 8595ae6 commit e621aca
Show file tree
Hide file tree
Showing 4 changed files with 468 additions and 493 deletions.
17 changes: 0 additions & 17 deletions agent/connectionchecker/connection_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"database/sql"
"fmt"
"io"
"math"
"net/http"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -140,22 +139,6 @@ func (cc *ConnectionChecker) checkMySQLConnection(ctx context.Context, dsn strin
} else {
res.Error = err.Error()
}
return &res
}

var count uint64
if err = db.QueryRowContext(ctx, "SELECT /* agent='connectionchecker' */ COUNT(*) FROM information_schema.tables").Scan(&count); err != nil {
res.Error = err.Error()
return &res
}

tableCount := int32(count)
if count > math.MaxInt32 {
tableCount = math.MaxInt32
}

res.Stats = &agentpb.CheckConnectionResponse_Stats{
TableCount: tableCount,
}

return &res
Expand Down
Loading

0 comments on commit e621aca

Please sign in to comment.