Skip to content

Commit d1df2a2

Browse files
committed
Rename MaxParallelismPerDatabase -> MaxParallelismPerTarget
1 parent ac3c4bf commit d1df2a2

6 files changed

Lines changed: 46 additions & 49 deletions

File tree

PSql.Deploy.Tests/Commands/NewSqlTargetDatabaseGroupCommandTests.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public void Invoke()
1919

2020
var group = ShouldBeGroup(output);
2121

22-
group.Name .ShouldBeNull();
23-
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
24-
group.Targets.Count .ShouldBe(2);
25-
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
26-
group.MaxParallelismPerDatabase.ShouldBe(Environment.ProcessorCount);
22+
group.Name .ShouldBeNull();
23+
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
24+
group.Targets.Count .ShouldBe(2);
25+
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
26+
group.MaxParallelismPerTarget.ShouldBe(Environment.ProcessorCount);
2727

2828
targets[0].ShouldNotBeNull();
2929
targets[0].ConnectionString.ShouldBe("Server=.;Database=a");
@@ -49,11 +49,11 @@ public void Invoke_Pipeline()
4949

5050
var group = ShouldBeGroup(output);
5151

52-
group.Name .ShouldBeNull();
53-
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
54-
group.Targets.Count .ShouldBe(3);
55-
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
56-
group.MaxParallelismPerDatabase.ShouldBe(Environment.ProcessorCount);
52+
group.Name .ShouldBeNull();
53+
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
54+
group.Targets.Count .ShouldBe(3);
55+
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
56+
group.MaxParallelismPerTarget.ShouldBe(Environment.ProcessorCount);
5757

5858
targets[0].ShouldNotBeNull();
5959
targets[0].ConnectionString.ShouldBe("Server=.;Database=a");
@@ -77,11 +77,11 @@ public void Invoke_WithName()
7777

7878
var group = ShouldBeGroup(output);
7979

80-
group.Name .ShouldBe("GroupA");
81-
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
82-
group.Targets.Count .ShouldBe(1);
83-
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
84-
group.MaxParallelismPerDatabase.ShouldBe(Environment.ProcessorCount);
80+
group.Name .ShouldBe("GroupA");
81+
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
82+
group.Targets.Count .ShouldBe(1);
83+
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
84+
group.MaxParallelismPerTarget.ShouldBe(Environment.ProcessorCount);
8585

8686
targets[0].ShouldNotBeNull();
8787
targets[0].ConnectionString.ShouldBe("Server=.;Database=a");
@@ -98,32 +98,32 @@ public void Invoke_WithMaxParallelism()
9898

9999
var group = ShouldBeGroup(output);
100100

101-
group.Name .ShouldBeNull();
102-
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
103-
group.Targets.Count .ShouldBe(1);
104-
group.MaxParallelism .ShouldBe(2);
105-
group.MaxParallelismPerDatabase.ShouldBe(Environment.ProcessorCount);
101+
group.Name .ShouldBeNull();
102+
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
103+
group.Targets.Count .ShouldBe(1);
104+
group.MaxParallelism .ShouldBe(2);
105+
group.MaxParallelismPerTarget.ShouldBe(Environment.ProcessorCount);
106106

107107
targets[0].ShouldNotBeNull();
108108
targets[0].ConnectionString.ShouldBe("Server=.;Database=a");
109109
}
110110

111111
[Test]
112-
public void Invoke_WithMaxParallelismPerDatabase()
112+
public void Invoke_WithMaxParallelismPerTarget()
113113
{
114114
var (output, exception) = Execute(
115115
"""
116-
New-SqlTargetDatabaseGroup 'Server=.;Database=a' -MaxParallelismPerDatabase 2
116+
New-SqlTargetDatabaseGroup 'Server=.;Database=a' -MaxParallelismPerTarget 2
117117
"""
118118
);
119119

120120
var group = ShouldBeGroup(output);
121121

122-
group.Name .ShouldBeNull();
123-
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
124-
group.Targets.Count .ShouldBe(1);
125-
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
126-
group.MaxParallelismPerDatabase.ShouldBe(2);
122+
group.Name .ShouldBeNull();
123+
group.Targets .ShouldNotBeNull().AssignTo(out var targets);
124+
group.Targets.Count .ShouldBe(1);
125+
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
126+
group.MaxParallelismPerTarget.ShouldBe(2);
127127

128128
targets[0].ShouldNotBeNull();
129129
targets[0].ConnectionString.ShouldBe("Server=.;Database=a");

PSql.Deploy.Tests/Data/SqlTargetDatabaseGroupTests.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void Construct_WithValues()
4040
group.Targets[1].ConnectionString.ShouldBe("Server = localhost; Database = B");
4141
group.Name .ShouldBe("My Group");
4242
group.MaxParallelism .ShouldBe(4);
43-
group.MaxParallelismPerDatabase .ShouldBe(2);
43+
group.MaxParallelismPerTarget .ShouldBe(2);
4444
}
4545

4646
[Test]
@@ -59,7 +59,7 @@ public void Construct_WithValues_Defaults()
5959
group.Targets[1].ConnectionString.ShouldBe("Server = localhost; Database = B");
6060
group.Name .ShouldBeNull();
6161
group.MaxParallelism .ShouldBe(Environment.ProcessorCount);
62-
group.MaxParallelismPerDatabase .ShouldBe(Environment.ProcessorCount) ;
62+
group.MaxParallelismPerTarget .ShouldBe(Environment.ProcessorCount) ;
6363
}
6464

6565
[Test]
@@ -108,8 +108,7 @@ public void Construct_FromReadOnlyList()
108108
actual.Targets[1].ConnectionString.ShouldBe("Server = localhost; Database = B");
109109
actual.Name .ShouldBeNull();
110110
actual.MaxParallelism .ShouldBe(Environment.ProcessorCount);
111-
actual.MaxParallelismPerDatabase .ShouldBe(Environment.ProcessorCount);
112-
// TODO: MaxParallelismPerTarget
111+
actual.MaxParallelismPerTarget .ShouldBe(Environment.ProcessorCount);
113112
}
114113

115114
[Test]
@@ -128,8 +127,7 @@ public void Construct_FromEnumerable()
128127
actual.Targets[1].ConnectionString.ShouldBe("Server = localhost; Database = B");
129128
actual.Name .ShouldBeNull();
130129
actual.MaxParallelism .ShouldBe(Environment.ProcessorCount);
131-
actual.MaxParallelismPerDatabase .ShouldBe(Environment.ProcessorCount);
132-
// TODO: MaxParallelismPerTarget
130+
actual.MaxParallelismPerTarget .ShouldBe(Environment.ProcessorCount);
133131
}
134132

135133
[Test]
@@ -141,8 +139,7 @@ public void Construct_FromConvertible()
141139
actual.Targets[0].ConnectionString.ShouldBe("Server = localhost; Database = A");
142140
actual.Name .ShouldBeNull();
143141
actual.MaxParallelism .ShouldBe(Environment.ProcessorCount);
144-
actual.MaxParallelismPerDatabase .ShouldBe(Environment.ProcessorCount);
145-
// TODO: MaxParallelismPerTarget
142+
actual.MaxParallelismPerTarget .ShouldBe(Environment.ProcessorCount);
146143
}
147144

148145
[Test]

PSql.Deploy/Commands/NewSqlTargetDatabaseGroupCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public class NewSqlTargetDatabaseGroupCommand : PSCmdlet
3636
public int MaxParallelism { get; set; }
3737

3838
/// <summary>
39-
/// <b>-MaxParallelismPerDatabase:</b>
39+
/// <b>-MaxParallelismPerTarget:</b>
4040
/// Maximum count of operations to perform in parallel against any one
41-
/// database. The default value is the number of logical processors on
42-
/// the local machine.
41+
/// target database. The default value is the number of logical
42+
/// processors on the local machine.
4343
/// </summary>
4444
[Parameter()]
4545
[ValidateRange(1, int.MaxValue)]
46-
public int MaxParallelismPerDatabase { get; set; }
46+
public int MaxParallelismPerTarget { get; set; }
4747

4848
// Collected targets from all ProcessRecord invocations
4949
private IReadOnlyList<SqlTargetDatabase>? _targets;
@@ -67,7 +67,7 @@ protected override void EndProcessing()
6767
Assume.NotNull(_targets);
6868

6969
WriteObject(new SqlTargetDatabaseGroup(
70-
_targets, Name, MaxParallelism, MaxParallelismPerDatabase
70+
_targets, Name, MaxParallelism, MaxParallelismPerTarget
7171
));
7272
}
7373

PSql.Deploy/Commands/PerTargetCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ private TargetSet MakeTargetSet()
181181
{
182182
return new()
183183
{
184-
Contexts = Context!,
185-
MaxParallelism = MaxParallelism,
186-
MaxParallelismPerDatabase = MaxParallelism
184+
Contexts = Context!,
185+
MaxParallelism = MaxParallelism,
186+
MaxParallelismPerTarget = MaxParallelism
187187
};
188188
}
189189

PSql.Deploy/Data/SqlTargetDatabaseGroup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public SqlTargetDatabaseGroup(
106106
/// <summary>
107107
/// Gets the maximum degree of parallelism per target database.
108108
/// </summary>
109-
public int MaxParallelismPerDatabase => _inner.MaxParallelismPerTarget;
109+
public int MaxParallelismPerTarget => _inner.MaxParallelismPerTarget;
110110

111111
private static (E.TargetGroup, IReadOnlyList<SqlTargetDatabase>)
112112
InitializeFrom(object obj)

PSql.Deploy/en-US/PSql.Deploy.dll-help.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@
909909
The New-SqlTargetDatabaseGroup cmdlet creates a SqlTargetDatabaseGroup object, which specifies a set of target databases along with the maximum degrees of parallelism with which to operate against those databases. The SqlTargetDatabaseGroup object is usable in the -Target parameter of the Invoke-SqlMigrations and Invoke-SqlSeed cmdlets.
910910
</maml:para>
911911
<maml:para>
912-
The parallelism properties include MaxParallelism, which specifies how many databases in the group can be processed simultaneously, and MaxParallelismPerDatabase, which specifies how many operations can be performed against a single database at one time. These properties allow you to tune performance when working with large numbers of databases.
912+
The parallelism properties include MaxParallelism, which specifies how many target databases in the group can be processed simultaneously, and MaxParallelismPerTarget, which specifies how many operations can be performed against a single target database at one time.
913913
</maml:para>
914914
<maml:para>
915915
The target database group supports an optional descriptive name, which will appear in command output and logs when operations are performed against the group.
@@ -932,7 +932,7 @@
932932
<command:parameterValue required="true">int</command:parameterValue>
933933
</command:parameter>
934934
<command:parameter required="false" position="named" pipelineInput="False" globbing="false">
935-
<maml:name>MaxParallelismPerDatabase</maml:name>
935+
<maml:name>MaxParallelismPerTarget</maml:name>
936936
<command:parameterValue required="true">int</command:parameterValue>
937937
</command:parameter>
938938
</command:syntaxItem>
@@ -1003,12 +1003,12 @@
10031003
<dev:defaultValue>Environment.ProcessorCount</dev:defaultValue>
10041004
</command:parameter>
10051005

1006-
<!-- -MaxParallelismPerDatabase -->
1006+
<!-- -MaxParallelismPerTarget -->
10071007
<command:parameter required="false" position="named" pipelineInput="False" globbing="false">
1008-
<maml:name>MaxParallelismPerDatabase</maml:name>
1008+
<maml:name>MaxParallelismPerTarget</maml:name>
10091009
<maml:description>
10101010
<maml:para>
1011-
Maximum count of operations to perform in parallel against one database. The default value is the number of logical processors on the local machine.
1011+
Maximum count of operations to perform in parallel against one target database. The default value is the number of logical processors on the local machine.
10121012
</maml:para>
10131013
</maml:description>
10141014
<command:parameterValue required="true">int</command:parameterValue>

0 commit comments

Comments
 (0)