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
azure:bootstrap-app -azure-pwd 123456 -azure-svc mytraveldemo c:/cloudify/examples/azure/travel |
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
install-application c:/cloudify/examples/azure/travel |
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
minAllowedInstances 1 | |
maxAllowedInstances 2 | |
scalingRules ([ scalingRule { | |
serviceStatistics { | |
metric "Total Requests Count" | |
movingTimeRangeInSeconds 20 | |
statistics Statistics.maximumThroughput | |
} |
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
Service parse( | |
String recipeFile, List<String> classpath, | |
Map<String, Object> properties, ServiceContext context) { | |
// add POJO base class, and classpath | |
cc = new CompilerConfiguration(); | |
cc.setScriptBaseClass( BaseDslScript.class.getName() ); | |
cc.setClasspathList(classpath); | |
// inject default imports |
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
class Service { | |
String name; | |
String type; | |
int numInstances; | |
ServiceLifecycle lifecycle; | |
Map<String, Object> customCommands; | |
} |
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
// Create a new Service object and initialize it with this closure | |
service { | |
//calls setName(), setType(), etc... | |
name "tomcat" | |
type "WEB_SERVER" | |
numInstances 1 | |
// context is injected automatically | |
def portIncrement = |
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
plugin { | |
name "jmx" | |
className "org.cloudifysource.usm.jmx.JmxMonitor" | |
config([ | |
"Total Requests Count": [ | |
"Catalina:type=GlobalRequestProcessor,name=\"http-bio-${httpPort}\"", | |
"requestCount" | |
], |
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
scalingRule { | |
serviceStatistics { | |
metric "Total Requests Count" | |
movingTimeRangeInSeconds 20 | |
statistics Statistics.maximumThroughput | |
} | |
highThreshold { | |
value 1 // request per second |
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
AtomicLong counter = new AtomicLong(0); | |
// expose counter as a monitor | |
monitors ([ | |
"counter" : { | |
return counter.get(); | |
}]) | |
// inject counter value | |
customCommands ([ |
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
scalingRule { | |
serviceStatistics { | |
metric "counter" | |
movingTimeRangeInSeconds 5 | |
statistics Statistics.averageOfAverages | |
} | |
OlderNewer