Skip to content

Instantly share code, notes, and snippets.

View shawnweisfeld's full-sized avatar

Shawn Weisfeld shawnweisfeld

View GitHub Profile
@shawnweisfeld
shawnweisfeld / gist:278ac6601807cc67ca18
Created June 25, 2014 13:18
ping a Azure CDN endpoint to see how fast you can get the file and record the results.
static void Main(string[] args)
{
var url = "http://az590556.vo.msecnd.net/app/ec951196-2be1-4539-9e8f-3fc9f59590a9/client.js";
while (true)
{
using (HttpClient client = new HttpClient())
{
var sw = new Stopwatch();
sw.Start();
@shawnweisfeld
shawnweisfeld / gist:16fe6afe0671edf3e163
Created July 2, 2014 15:09
azure service bus throughput test
static void Main(string[] args)
{
ResetTheQueue();
PerformTheTest();
Console.ReadKey();
}
private static void PerformTheTest()
public class MyTraceListener : TraceListener
{
DiagnosticMonitorTraceListener _azureTL = new DiagnosticMonitorTraceListener();
public override void Write(string message)
{
_azureTL.Write(message);
}
public override void WriteLine(string message)
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
var downloads = new List<Task>();
while (downloads.Count < 10)
{
var configurationOptions = new ConfigurationOptions
{
EndPoints =
{
{ "server.redis.cache.windows.net", 6380 }
},
SyncTimeout = int.MaxValue,
Ssl = true,
Password = "mypassword"
};
Stopwatch sw = new Stopwatch();
sw.Start();
var t1 = Massive.DynamicModel.Open(connection);
var foo = t1.Query("SELECT @@version AS Version").FirstOrDefault().Version;
sw.Stop();
return sw.ElapsedMilliseconds;
Stopwatch sw = new Stopwatch();
sw.Start();
var data = Guid.NewGuid().ToString();
int replicated = 0;
var primary = Massive.DynamicModel.Open("T1");
var secondary = Massive.DynamicModel.Open("T3");
primary.Execute("INSERT INTO MyTable ([info]) VALUES (@0)", data);
static void Main(string[] args)
{
var url = "http://localhost:60218/";
while (true)
{
try
{
using (HttpClient client = new HttpClient())
using (HttpResponseMessage response = client.GetAsync(url).Result)
public class HomeController : Controller
{
public ActionResult Index()
{
return new ContentResult()
{
Content = Environment.MachineName
};
}
}
using DistributedMutex;
using Microsoft.WindowsAzure.Storage;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Web;