-
Build the images
$ packer build template.json
-
Import and start an image.
$ vagrant up --provider=aws
$ vagrant up --provider=virtualbox
I'm leaving this gist in place for posterity, but the project now has a home: | |
https://github.com/cuviper/rust-libprobe |
# encoding: utf-8 | |
require File.join(File.dirname(__FILE__), 'helper') | |
class TestIntegration < MosquittoTestCase | |
def setup | |
@result = nil | |
@client = nil | |
connected = false | |
@client = Mosquitto::Client.new(nil, true) |
require 'json' | |
require 'socket' | |
abort "Usage: #{$0} username xi_api_key" if ARGV.size != 2 | |
username = ARGV[0] | |
xi_api_key = ARGV[1] | |
xi = TCPSocket.open('api.xively.com', 8081) | |
xi.puts({ |
Gatling is an awesome modern load-testing framework written in Scala with asyncronous actors. It's been designed by the folks at Excilys and had been gaining some attention recently.
There a few ways you can get started with Gatling:
Each of these has it's pros and cons, so I have figured yet another way that is meant to be quite easy.
config COSM_PROV_BASIC | |
tirstate "Cosm-connected product activation code generator" | |
default y | |
select CRYPTO_HMAC && CRYPTO_SHA1 |
#!/bin/bash -xe | |
if [ -z $1 ] | |
then | |
echo "Usage: $0 <product_secret> [<iface>]" | |
exit -1 | |
fi | |
if [ -z $2 ] | |
then | |
# get default network interface | |
iface=`/usr/sbin/netstat -rn | /usr/bin/awk '/^default/{print $6;exit}'` |
public static string CreateDatapoint(string feedId, string datastreamId, string value) | |
{ | |
string url = string.Format("http://api.cosm.com/v2/feeds/{0}/datastreams/{1}/datapoints", feedId, datastreamId); | |
var datapoints = new {datapoints = new[] {new {at = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"), value}}}; | |
var datapointsJson = new JavaScriptSerializer().Serialize(datapoints); | |
var webClient = new WebClient(); | |
webClient.Headers.Set("X-ApiKey", "KbI9MZtLvhaOuAi0DKXWzc4UZk-SAKxhQjd3MHJtd2ZwYz0g"); | |
return webClient.UploadString(url, "POST", datapointsJson); | |
} |
var webClient = new WebClient(); | |
webClient.Headers.Set("X-ApiKey", "KbI9MZtLvhaOuAi0DKXWzc4UZk-SAKxhQjd3MHJtd2ZwYz0g"); | |
var response = webClient.UploadString( | |
"http://api.cosm.com/v2/feeds/92158/datastreams/WaterLevel/datapoints", | |
"POST", | |
@"{ | |
""datapoints"":[ | |
{""at"":""2012-12-18T04:00:00Z"",""value"":""294""}, | |
{""at"":""2012-12-18T04:01:00Z"",""value"":""295""}, | |
{""at"":""2012-12-18T04:02:00Z"",""value"":""296""}, |
ruby-1.9.3-p194 |