Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Feb 22, 2024
1 parent 633a9b2 commit 6069842
Show file tree
Hide file tree
Showing 9 changed files with 1,073 additions and 1,073 deletions.
4 changes: 3 additions & 1 deletion api-tests/inventory/agents_postgres_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func TestPostgresExporter(t *testing.T) {
},

SkipConnectionCheck: true,
MaxConnections: 10,
})
agentID := PostgresExporter.PostgresExporter.AgentID
defer pmmapitests.RemoveAgents(t, agentID)
Expand All @@ -83,7 +84,8 @@ func TestPostgresExporter(t *testing.T) {
CustomLabels: map[string]string{
"custom_label_postgres_exporter": "postgres_exporter",
},
Status: &AgentStatusUnknown,
Status: &AgentStatusUnknown,
MaxConnections: 10,
},
},
}, getAgentRes)
Expand Down
2,126 changes: 1,062 additions & 1,064 deletions api/inventorypb/agents.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/inventorypb/agents.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/inventorypb/agents.proto
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ message AddPostgresExporterRequest {
// Optionally expose the exporter process on all public interfaces
bool expose_exporter = 17;
// Maximum number of connections from exporter to the database instance.
int32 max_exporter_connections = 18;
int32 max_connections = 18;
}

message AddPostgresExporterResponse {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/inventorypb/json/inventorypb.json
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@
],
"x-order": 14
},
"max_exporter_connections": {
"max_connections": {
"description": "Maximum number of connections from exporter to the database instance.",
"type": "integer",
"format": "int32",
Expand Down
2 changes: 1 addition & 1 deletion api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -5606,7 +5606,7 @@
"title": "Optionally expose the exporter process on all public interfaces",
"x-order": 16
},
"max_exporter_connections": {
"max_connections": {
"description": "Maximum number of connections from exporter to the database instance.",
"type": "integer",
"format": "int32",
Expand Down
2 changes: 1 addition & 1 deletion api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,7 @@
"title": "Optionally expose the exporter process on all public interfaces",
"x-order": 16
},
"max_exporter_connections": {
"max_connections": {
"description": "Maximum number of connections from exporter to the database instance.",
"type": "integer",
"format": "int32",
Expand Down
4 changes: 2 additions & 2 deletions managed/models/agent_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type PostgreSQLOptionsParams interface {
// PostgreSQLExtendedOptionsParams contains extended parameters for PostgreSQL exporter.
type PostgreSQLExtendedOptionsParams interface {
GetAutoDiscoveryLimit() int32
GetMaxExporterConnections() int32
GetMaxConnections() int32
}

// PostgreSQLOptionsFromRequest creates PostgreSQLOptions object from request.
Expand All @@ -74,7 +74,7 @@ func PostgreSQLOptionsFromRequest(params PostgreSQLOptionsParams) *PostgreSQLOpt
// PostgreSQL exporter has these parameters but they are not needed for QAN agent.
if extendedOptions, ok := params.(PostgreSQLExtendedOptionsParams); ok && extendedOptions != nil {
res.AutoDiscoveryLimit = extendedOptions.GetAutoDiscoveryLimit()
res.MaxExporterConnections = extendedOptions.GetMaxExporterConnections() // TODO: is it a right place for this?
res.MaxExporterConnections = extendedOptions.GetMaxConnections() // TODO: is it a right place for this?
}

return res
Expand Down

0 comments on commit 6069842

Please sign in to comment.