Skip to content

Commit 5c23b4c

Browse files
vimalmeena238jotruon
authored andcommitted
Added maxparallel variables based on number of available cores
1 parent f0d67c2 commit 5c23b4c

9 files changed

+32
-14
lines changed

internal/resourcediscovery/export_compartment.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ type ResourceDiscoveryStage int
4545
const (
4646
Discovery ResourceDiscoveryStage = 1
4747
GeneratingState = 2
48-
// maximum goroutines for finding resources in a step at base level.
49-
// Value of MaxParallelFindResources is decided based on perf analysis and experiments.
50-
// Note: SubResources will be discovered sequentially.
51-
MaxParallelFindResource = 16
5248
)
5349

5450
var (
@@ -57,6 +53,8 @@ var (
5753
missingAttributesPerResourceLock sync.Mutex
5854
sem chan struct{}
5955
exportConfigProvider oci_common.ConfigurationProvider
56+
MaxParallelFindResource int
57+
MaxParallelChunks int
6058

6159
tfexecConfigVar = tfexec.Config
6260
tfexecStateVar = tfexec.State
@@ -292,6 +290,15 @@ func RunExportCommand(args *tf_export.ExportCommandArgs) (err error, status Stat
292290

293291
sem = make(chan struct{}, args.Parallelism)
294292

293+
// maximum goroutines for finding resources in a step at base level.
294+
// Value of MaxParallelFindResources is decided based on perf analysis and experiments.
295+
// Note: SubResources will be discovered sequentially.
296+
numCPU := runtime.NumCPU()
297+
MaxParallelFindResource = numCPU * 4
298+
// max parallel chunks for state genation that can be executed in parallel
299+
MaxParallelChunks = numCPU
300+
utils.Debugf("[INFO] Setting MaxParalleFindResources=%d, MaxParallelChunks=%d", MaxParallelFindResource, MaxParallelChunks)
301+
295302
ctx, err := createResourceDiscoveryContext(clients.(*tf_client.OracleClients), args, tenancyOcid)
296303
if err != nil {
297304
utils.Logln(err.Error())

internal/resourcediscovery/export_resource_helpers.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ const (
4646
StatusPartialSuccess Status = 64
4747

4848
// parallelism configs
49-
ChunkSize int = 10
50-
MaxParallelChunks int = 4
49+
ChunkSize int = 10
5150
)
5251

5352
var isAllDataSourceLock sync.Mutex

website/docs/d/management_agent_management_agent_plugins.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ data "oci_management_agent_management_agent_plugins" "test_management_agent_plug
2121
compartment_id = var.compartment_id
2222
2323
#Optional
24+
<<<<<<< ours
25+
agent_id = oci_cloud_bridge_agent.test_agent.id
26+
=======
2427
agent_id = var.management_agent_id
28+
>>>>>>> theirs
2529
display_name = var.management_agent_plugin_display_name
2630
platform_type = var.management_agent_plugin_platform_type
2731
state = var.management_agent_plugin_state

website/docs/d/opsi_host_insight.html.markdown

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ The following arguments are supported:
3333
The following attributes are exported:
3434

3535
* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
36-
<<<<<<< ours
3736
* `compute_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compute Instance
38-
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
39-
=======
40-
>>>>>>> theirs
37+
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
4138
* `enterprise_manager_bridge_id` - OPSI Enterprise Manager Bridge OCID
4239
* `enterprise_manager_entity_display_name` - Enterprise Manager Entity Display Name
4340
* `enterprise_manager_entity_identifier` - Enterprise Manager Entity Unique Identifier

website/docs/d/opsi_host_insights.html.markdown

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ The following arguments are supported:
3939
* `compartment_id_in_subtree` - (Optional) A flag to search all resources within a given compartment and all sub-compartments.
4040
* `enterprise_manager_bridge_id` - (Applicable when entity_source=EM_MANAGED_EXTERNAL_HOST) Unique Enterprise Manager bridge identifier
4141
* `exadata_insight_id` - (Applicable when entity_source=EM_MANAGED_EXTERNAL_HOST) [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of exadata insight resource.
42-
<<<<<<< ours
4342
* `host_type` - (Optional) Filter by one or more host types. Possible values are CLOUD-HOST, EXTERNAL-HOST
44-
=======
45-
* `host_type` - (Optional) Filter by one or more host types. Possible value is EXTERNAL-HOST.
46-
>>>>>>> theirs
4743
* `id` - (Optional) Optional list of host insight resource [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
4844
* `platform_type` - (Optional) Filter by one or more platform types. Supported platformType(s) for MACS-managed external host insight: [LINUX, SOLARIS, WINDOWS]. Supported platformType(s) for MACS-managed cloud host insight: [LINUX]. Supported platformType(s) for EM-managed external host insight: [LINUX, SOLARIS, SUNOS, ZLINUX, WINDOWS].
4945
* `state` - (Optional) Lifecycle states

website/docs/r/database_external_database_connector.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ resource "oci_database_external_database_connector" "test_external_database_conn
3535
protocol = var.external_database_connector_connection_string_protocol
3636
service = var.external_database_connector_connection_string_service
3737
}
38+
<<<<<<< ours
39+
connector_agent_id = oci_cloud_bridge_agent.test_agent.id
40+
=======
3841
connector_agent_id = oci_database_connector_agent.test_connector_agent.id
42+
>>>>>>> theirs
3943
display_name = var.external_database_connector_display_name
4044
external_database_id = oci_database_database.test_database.id
4145

website/docs/r/database_vm_cluster_network.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ resource "oci_database_vm_cluster_network" "test_vm_cluster_network" {
3434
}
3535
vm_networks {
3636
#Required
37+
<<<<<<< ours
38+
=======
3739
domain_name = var.vm_cluster_network_vm_networks_domain_name
3840
gateway = var.vm_cluster_network_vm_networks_gateway
3941
netmask = var.vm_cluster_network_vm_networks_netmask
42+
>>>>>>> theirs
4043
network_type = var.vm_cluster_network_vm_networks_network_type
4144
nodes {
4245
#Required

website/docs/r/management_agent_management_agent.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ This resource provides the Management Agent resource in Oracle Cloud Infrastruct
1717
```hcl
1818
resource "oci_management_agent_management_agent" "test_management_agent" {
1919
#Required
20+
<<<<<<< ours
21+
managed_agent_id = oci_cloud_bridge_agent.test_agent.id
22+
=======
2023
managed_agent_id = oci_management_agent_managed_agent.test_managed_agent.id
24+
>>>>>>> theirs
2125
}
2226
```
2327

website/docs/r/stack_monitoring_discovery_job.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ resource "oci_stack_monitoring_discovery_job" "test_discovery_job" {
2121
compartment_id = var.compartment_id
2222
discovery_details {
2323
#Required
24+
<<<<<<< ours
25+
agent_id = oci_cloud_bridge_agent.test_agent.id
26+
=======
2427
agent_id = var.management_agent_id
28+
>>>>>>> theirs
2529
properties {
2630
2731
#Optional

0 commit comments

Comments
 (0)