Skip to content

Instantly share code, notes, and snippets.

View paulbatum's full-sized avatar

Paul Batum paulbatum

View GitHub Profile
@paulbatum
paulbatum / triage.md
Last active January 3, 2018 21:46
Azure Functions Triage Queries
@paulbatum
paulbatum / Test1.cs
Created December 22, 2017 23:22
Example test project for testing the default http trigger in azure functions
using System;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using FunctionApp22_UnitTesting;
using Microsoft.Azure.WebJobs.Host;
using Xunit;
@paulbatum
paulbatum / BCryptTest.cs
Created November 24, 2017 19:02
Functions Tiered Jit Test
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json;
namespace TieredJitTest
@paulbatum
paulbatum / EventHubTrigger.csx
Created October 11, 2017 21:00
Setting PartitionKey in Azure Functions
#r "Microsoft.ServiceBus"
using System;
using System.Text;
using Microsoft.ServiceBus.Messaging;
public static void Run(EventData myEventHubMessage, TraceWriter log)
{
log.Info($"C# Event Hub trigger function processed a message with partition key: {myEventHubMessage.PartitionKey}");
}
@paulbatum
paulbatum / results.md
Last active July 19, 2017 01:29
Functions min threads fix results

HTTP latency in milliseconds @ 50 RPS

Each row is a 5 minute run at constant load of 50 RPS.

Scenario Min Median P95 P99 Max
Dedicated without fix 154 158.1 999.6 2128 3341.9
Dedicated without fix 154.2 158.8 1204.8 2058.8 3845.8
Dedicated without fix 154 158.6 941 2430.4 4618.1
Dedicated without fix 154.2 158.8 882.1 2089.3 3515.9
@paulbatum
paulbatum / run.csx
Created December 27, 2016 18:59
Functions parallelism
using System.Net;
using System.Threading.Tasks.Dataflow;
public enum Mode
{
Sequential,
Batches,
Dataflow
}
@paulbatum
paulbatum / template.json
Created December 1, 2016 23:41
Consumption function app from github repo ARM template
{
"parameters": {
"name": {
"type": "string"
}
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "[parameters('name')]",
{
"parameters": {
"name": {
"type": "string",
"defaultValue": "pbsynctest4"
},
"storageName": {
"type": "string",
"defaultValue": "pbsynctest4"
},
@paulbatum
paulbatum / runnerapp-function.json
Last active September 17, 2016 00:37
Function Updater
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "*/10 * * * * *"
},
{
"type": "table",
using System;
using System.Threading.Tasks;
using System.Diagnostics;
static Dictionary<int,byte[]> Allocations = new Dictionary<int,byte[]>();
public static async Task Run(string id, int message, TraceWriter log)
{
log.Verbose($"Machine: {Environment.MachineName}");