testing chaos with more readable/simpler ids and labels
This commit is contained in:
parent
088ba0f4a7
commit
bb47f98bf0
1 changed files with 4 additions and 8 deletions
|
|
@ -62,7 +62,7 @@ func (gs *dslGenState) gen(maxi int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gs *dslGenState) genNode(containerID string) (string, error) {
|
func (gs *dslGenState) genNode(containerID string) (string, error) {
|
||||||
nodeID := gs.randStr(32, true)
|
nodeID := gs.randStr(8, true)
|
||||||
if containerID != "" {
|
if containerID != "" {
|
||||||
nodeID = containerID + "." + nodeID
|
nodeID = containerID + "." + nodeID
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ func (gs *dslGenState) node() error {
|
||||||
|
|
||||||
if gs.roll(25, 75) == 0 {
|
if gs.roll(25, 75) == 0 {
|
||||||
// 25% chance of adding a label.
|
// 25% chance of adding a label.
|
||||||
gs.g, err = d2oracle.Set(gs.g, nodeID, nil, go2.Pointer(gs.randStr(256, false)))
|
gs.g, err = d2oracle.Set(gs.g, nodeID, nil, go2.Pointer(gs.randStr(8, false)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -154,7 +154,7 @@ func (gs *dslGenState) edge() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if gs.randBool() {
|
if gs.randBool() {
|
||||||
gs.g, err = d2oracle.Set(gs.g, key, nil, go2.Pointer(gs.randStr(128, false)))
|
gs.g, err = d2oracle.Set(gs.g, key, nil, go2.Pointer(gs.randStr(8, false)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -191,11 +191,7 @@ func (gs *dslGenState) randBool() bool {
|
||||||
// TODO go back to using xrand.String, currently some incompatibility with
|
// TODO go back to using xrand.String, currently some incompatibility with
|
||||||
// stuffing these strings into a script for dagre
|
// stuffing these strings into a script for dagre
|
||||||
func randRune() rune {
|
func randRune() rune {
|
||||||
if mathrand.Int31n(100) == 0 {
|
return mathrand.Int31n(26) + 97
|
||||||
// Generate newline 1% of the time.
|
|
||||||
return '\n'
|
|
||||||
}
|
|
||||||
return mathrand.Int31n(128) + 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gs *dslGenState) findOuterSequenceDiagram(nodeID string) string {
|
func (gs *dslGenState) findOuterSequenceDiagram(nodeID string) string {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue