-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1311005
commit 46413df
Showing
361 changed files
with
17,423 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
|
||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
st | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
startPrank | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
startPrank(){ | ||
|
||
} | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
startPrank(prankConfig){ | ||
|
||
} | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
class ChaosControl { | ||
constructor(expressApplication, configuration) { | ||
console.log(`Chaos monkey is set to active`); | ||
this.configuration = configuration; | ||
this.app = expressApplication; | ||
} | ||
|
||
start() { | ||
console.log(`Opening the zoo now`); | ||
const allPrank = this.getAllActivePranks([this.app]); | ||
allPrank.forEach(prank => { | ||
prank.on("sinStart", config => { | ||
console.log(config); | ||
}); | ||
|
||
prank.on("sinOccured", config => { | ||
console.log(`Sin has just occured ${config}`); | ||
}); | ||
}); | ||
} | ||
|
||
getSinSchedule(sinConfig) { | ||
const ScheduleClass = require(`../schedules/${sinConfig.schedule.type}`); | ||
|
||
return new ScheduleClass(sinConfig.schedule); | ||
} | ||
|
||
startPrank(prankConfig){ | ||
|
||
} | ||
|
||
getAllActivePranks(sinParams) { | ||
const allSins = []; | ||
this.configuration.pranks | ||
.filter((prank) => prank.active === true) | ||
.forEach(sinConfiguration => { | ||
const SinClass = require(`../pranks/${sinConfiguration.file}`); | ||
const sinSchedule = this.getSinSchedule(sinConfiguration) | ||
allSins.push( | ||
new SinClass( | ||
sinConfiguration, | ||
sinSchedule, | ||
...sinParams | ||
) | ||
); | ||
sinSchedule.start(); | ||
}); | ||
|
||
return allSins; | ||
} | ||
} | ||
|
||
module.exports = ChaosControl; |
Oops, something went wrong.