forked from helmutkemper/iotmaker.docker.builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncConfigChaosScene.go
More file actions
66 lines (65 loc) · 2.69 KB
/
funcConfigChaosScene.go
File metadata and controls
66 lines (65 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package iotmakerdockerbuilder
// ConfigChaosScene
//
// English:
//
// Add and configure a test scene prevents all containers in the scene from stopping at the same time
//
// Input:
// sceneName: unique name for the scene
// maxStopedContainers: Maximum number of stopped containers
// maxPausedContainers: Maximum number of paused containers
// maxTotalPausedAndStoppedContainers: Maximum number of containers stopped and paused at the same
// time
//
// Note:
//
// * The following functions are used together during chaos testing:
// [optional] iotmakerdockerbuilder.ConfigChaosScene()
//
// Mandatory set:
// ContainerBuilder.EnableChaosScene()
// ContainerBuilder.SetTimeOnContainerUnpausedStateOnChaosScene()
// ContainerBuilder.SetTimeToStartChaosOnChaosScene()
// ContainerBuilder.SetTimeToRestartThisContainerAfterStopEventOnChaosScene()
// ContainerBuilder.SetTimeOnContainerPausedStateOnChaosScene()
// ContainerBuilder.SetTimeBeforeStartChaosInThisContainerOnChaosScene()
// ContainerBuilder.SetSceneNameOnChaosScene()
// [optional] ContainerBuilder.ContainerSetDisabePauseOnChaosScene()
// [optional] ContainerBuilder.ContainerSetDisabeStopOnChaosScene()
//
// Português:
//
// Adiciona e configura uma cena de teste impedindo que todos os container da cena parem ao mesmo
// tempo
//
// Entrada:
// sceneName: Nome único para a cena
// maxStopedContainers: Quantidade máxima de containers parados
// maxPausedContainers: Quantidade máxima de containers pausados
// maxTotalPausedAndStoppedContainers: Quantidade máxima de containers parados e pausados ao mesmo
// tempo
//
// Nota:
//
// * As funções a seguir são usadas em conjunto durante o teste de caos:
// [opcional] iotmakerdockerbuilder.ConfigChaosScene()
//
// Conjunto obrigatório:
// ContainerBuilder.EnableChaosScene()
// ContainerBuilder.SetTimeOnContainerUnpausedStateOnChaosScene()
// ContainerBuilder.SetTimeToStartChaosOnChaosScene()
// ContainerBuilder.SetTimeToRestartThisContainerAfterStopEventOnChaosScene()
// ContainerBuilder.SetTimeOnContainerPausedStateOnChaosScene()
// ContainerBuilder.SetTimeBeforeStartChaosInThisContainerOnChaosScene()
// ContainerBuilder.SetSceneNameOnChaosScene()
// [opcional] ContainerBuilder.ContainerSetDisabePauseOnChaosScene()
// [opcional] ContainerBuilder.ContainerSetDisabeStopOnChaosScene()
func ConfigChaosScene(
sceneName string,
maxStopedContainers,
maxPausedContainers,
maxTotalPausedAndStoppedContainers int,
) {
theater.ConfigScene(sceneName, maxStopedContainers, maxPausedContainers, maxTotalPausedAndStoppedContainers)
}