Skip to content

Commit

Permalink
Remove enable_query_runner setting (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlinsley authored Jan 6, 2025
1 parent 7e338b0 commit e8b078c
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 525 deletions.
7 changes: 3 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ type ServerConfig struct {
ErrorCallback string `ini:"error_callback"`
SuccessCallback string `ini:"success_callback"`

DisableLogs bool `ini:"disable_logs"`
DisableActivity bool `ini:"disable_activity"`
EnableLogExplain bool `ini:"enable_log_explain"`
EnableQueryRunner bool `ini:"enable_query_runner"`
DisableLogs bool `ini:"disable_logs"`
DisableActivity bool `ini:"disable_activity"`
EnableLogExplain bool `ini:"enable_log_explain"`

DbURL string `ini:"db_url"`
DbURLFile string `ini:"db_url_file"`
Expand Down
3 changes: 0 additions & 3 deletions config/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ func getDefaultConfig() *ServerConfig {
if enableLogExplain := os.Getenv("PGA_ENABLE_LOG_EXPLAIN"); enableLogExplain != "" {
config.EnableLogExplain = parseConfigBool(enableLogExplain)
}
if enableQueryRunner := os.Getenv("PGA_ENABLE_QUERY_RUNNER"); enableQueryRunner != "" {
config.EnableQueryRunner = parseConfigBool(enableQueryRunner)
}
if dbURL := os.Getenv("DB_URL"); dbURL != "" {
config.DbURL = dbURL
}
Expand Down
1 change: 0 additions & 1 deletion input/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func getCollectorConfig(c config.ServerConfig) state.CollectorConfig {
DisableLogs: c.DisableLogs,
DisableActivity: c.DisableActivity,
EnableLogExplain: c.EnableLogExplain,
EnableQueryRunner: c.EnableQueryRunner,
DbName: c.DbName,
DbUsername: c.DbUsername,
DbHost: c.DbHost,
Expand Down
1,012 changes: 501 additions & 511 deletions output/pganalyze_collector/full_snapshot.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion output/transform/collector_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func transformCollectorConfig(s snapshot.FullSnapshot, state state.TransientStat
DisableLogs: c.DisableLogs,
DisableActivity: c.DisableActivity,
EnableLogExplain: c.EnableLogExplain,
EnableQueryRunner: c.EnableQueryRunner,
DbName: c.DbName,
DbUsername: c.DbUsername,
DbHost: c.DbHost,
Expand Down
2 changes: 1 addition & 1 deletion protobuf/full_snapshot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ message CollectorConfig {
bool disable_logs = 2;
bool disable_activity = 3;
bool enable_log_explain = 4;
bool enable_query_runner = 5;
reserved 5; // enable_query_runner, now enabled automatically if helper function is defined

string db_name = 14;
string db_username = 15;
Expand Down
4 changes: 1 addition & 3 deletions runner/query_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ func SetupQueryRunnerForAllServers(ctx context.Context, servers []*state.Server,
case <-cleanupInterval.C:
cleanup(server)
default:
if server.Config.EnableQueryRunner {
run(ctx, server, collectionOpts, logger)
}
run(ctx, server, collectionOpts, logger)
time.Sleep(1 * time.Second)
}
}
Expand Down
1 change: 0 additions & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ type CollectorConfig struct {
DisableLogs bool
DisableActivity bool
EnableLogExplain bool
EnableQueryRunner bool
DbName string
DbUsername string
DbHost string
Expand Down

0 comments on commit e8b078c

Please sign in to comment.