Set-ServiceFabricChaosSchedule
Chaos Scheduler tarafından kullanılacak zamanlamayı ayarlayın.
Syntax
Set-ServiceFabricChaosSchedule
-ChaosScheduleDescription <ChaosScheduleDescription>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
Set-ServiceFabricChaosSchedule cmdlet'i, Zamanlamayı Chaos Scheduler tarafından kullanılacak şekilde ayarlar. Chaos Scheduler, belirtilen zamanlamaya göre Chaos çalıştırmaya başlar.
Örnekler
Örnek 1
PS C:\> $JobStartTime = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeUtc (0,0)
PS C:\> $JobEndTime = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeUtc (12,59)
PS C:\> $JobTimeRange = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeRangeUtc ($JobStartTime, $JobEndTime)
PS C:\> $activeDays = New-Object -TypeName System.Collections.Generic.HashSet[DayOfWeek]
PS C:\> $activeDays.Add([System.DayOfWeek]::Monday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Tuesday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Wednesday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Thursday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Friday)
PS C:\> $JobActiveDays = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleJobActiveDays ($activeDays)
PS C:\> $JobActiveTimes = New-Object -TypeName System.Collections.Generic.List[System.Fabric.Chaos.DataStructures.ChaosScheduleTimeRangeUtc]
PS C:\> $JobActiveTimes.Add($JobTimeRange)
PS C:\> $Job = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleJob ("adhoc", $JobActiveDays, $JobActiveTimes)
PS C:\> $Jobs.Add($Job)
PS C:\> $ChaosParameters = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosParameters
PS C:\> $ChaosParametersDictionary = New-Object 'System.Collections.Generic.Dictionary[string,System.Fabric.Chaos.Datastructures.ChaosParameters]'
PS C:\> $ChaosParametersDictionary.Add("adhoc", $ChaosParameters)
PS C:\> $Now = Get-Date
PS C:\> $StartTime = $Now.ToUniversalTime()
PS C:\> $EndTime = $StartTime.AddDays(100)
PS C:\> $ChaosSchedule = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosSchedule ($StartTime, $EndTime, $ChaosParametersDictionary, $Jobs)
PS C:\> $ChaosScheduleDescription = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleDescription (0, $ChaosSchedule)
PS C:\> Set-ServiceFabricChaosSchedule -ChaosSchedule $ChaosScheduleDescription
Chaos'un Pazartesi'den başlayıp Cuma'yı (UTC saat dilimine göre) bitirerek günde 24 saat çalıştırıldığını belirten bir zamanlama ayarlayın. Bu zamanlama 100 gün boyunca etkin kalacaktır ve bu süre boyunca Chaos Scheduler, Chaos'u çalıştırmak için bu zamanlamayı izleyecektir. Zamanlamayı durdurmak için Stop-ServiceFabricChaos cmdlet'ini kullanın.
Parametreler
-ChaosScheduleDescription
Chaos Scheduler'ın kullanması için ayarlanacak zamanlama.
Type: | ChaosScheduleDescription |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSec
İşlemin zaman aşımı süresini saniye cinsinden belirtir.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Girişler
None
Çıkışlar
System.Object