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
UpstreamLatency = (CurrentTime - RequestReceivedTimestamp) | |
DownstreamLatency = Approximate time needed to return a response to the client after this I/O operation completes. | |
Timeout = Global Timeout - (UpstreamLatency + DownstreamLatency) | |
if (Timeout > MaximumTimeout) Timeout = MaximumTimeout | |
if (Timeout < MinimumTimeout) Timeout = MinimumTimeout |
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
var failedTests = []; | |
new Mocha() | |
.ui("bdd") | |
.reporter("tap") | |
.addFile(__dirname + '/' + testSuiteName + '.js') | |
.run() | |
.on('fail', function (test, err) { | |
failedTests.push(test); | |
}) | |
.on('end', function () { |
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
// The following recipe snippet shows custom commands that forward the requests to the network cloud driver | |
// See also: | |
// https://github.com/CloudifySource/Cloudify-iTests/blob/master/src/main/resources/apps/USM/usm/networks/openstack/floatingips/floatingips-service.groovy | |
customCommands ([ | |
"getMachineIp" : { return context.getPrivateAddress() }, | |
"getPublicAddress" : { return context.getPublicAddress() }, | |
"getFloatingIp" : { return context.attributes.thisInstance["floatingIp"] }, | |
"getApplicationNetworkIp" : { return System.getenv()['CLOUDIFY_APPLICATION_NETWORK_IP'] }, | |
"assignFloatingIp" : { |
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
// Calculates the sum of all instances metrics and divides by the number of instances (average) | |
instancesStatistics Statistics.average | |
// Selects the instance metric with the greatest value (maximum) | |
instancesStatistics Statistics.maximum | |
// Selects the instance metric with the smallest value (minimum) | |
instancesStatistics Statistics.minimum | |
// Selects the instance metric that is greater than 10% of the other metrics and |
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
import kafka.producer.KeyedMessage; | |
import kafka.producer.async.DefaultEventHandler; | |
import org.aspectj.lang.JoinPoint; | |
import org.aspectj.lang.annotation.AfterReturning; | |
import org.aspectj.lang.annotation.AfterThrowing; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.aspectj.lang.annotation.Before; | |
import scala.collection.JavaConversions; | |
import scala.collection.Seq; |
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
{ | |
"timestamp" : "1355983011", | |
"ipaddress" : "10.0.0.1", | |
"tasks" : [ "http://broker/tasks/task1.json" ], | |
"executor" : "cloud-executor" | |
} |
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
public class TweetArchiveFilter implements EventTemplateProvider { | |
public SQLQuery<SpaceDocument> getTemplate() { | |
return new SQLQuery<SpaceDocument>("Tweet", "Processed = ?", true); | |
} | |
} |
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
public class TweetParser { | |
SQLQuery<SpaceDocument> getTemplate() { | |
return new SQLQuery<SpaceDocument>("Tweet", "Processed = ?", false); | |
} | |
public SpaceDocument eventListener(SpaceDocument tweet) { | |
Long id = (Long) tweet.getProperty("Id"); | |
String text = tweet.getProperty("Text"); |
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
+-------------+ +-------------+ | |
| In-memory | | Disk | | |
| (XAP) | | (Cassandra) | | |
| ---- archiver ---> | | |
| Realtime | | Queries | | |
| Processing | | | | |
+-------------+ +-------------+ |
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 A { | |
} |
NewerOlder