Skip to content

Instantly share code, notes, and snippets.

Ryan Kennedy ryankennedy

View GitHub Profile
@ryankennedy
ryankennedy / proto_parse.feature
Last active Sep 6, 2017
Cucumber definition for a simple Protocol Buffer parsing test
View proto_parse.feature
Feature: Parsing Protocol Buffer schemas
Scenario: Parsing a valid Protocol Buffer schema
Given a Protocol Buffer schema named my_message.proto with body
"""
syntax = "proto3";
message MyMessage {
string message_content = 1;
}
@ryankennedy
ryankennedy / hw-base.txt
Created Apr 22, 2016
Benchmark results comparing the baseline TechEmpower Dropwizard code with a version packing an optimized Guava.
View hw-base.txt
===============
Primer Requests
===============
Running 5s test @ http://localhost:9090/json
8 threads and 8 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.61ms 28.59ms 287.04ms 96.75%
Req/Sec 169.75 52.18 300.00 69.27%
Latency Distribution
50% 7.11ms
@ryankennedy
ryankennedy / json_bench.sh
Created Apr 22, 2016
Script that replicates the traffic being generated by the TechEmpower JSON serving benchmark.
View json_bench.sh
#!/bin/sh
HOST=localhost
PORT=9090
URL=/json
CONTENT_TYPE_HEADER="application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7"
CONNECTION_HEADER="Connection: keep-alive"
# Parameters:
@ryankennedy
ryankennedy / ab.log
Created Oct 23, 2015
ApacheBench SSL error
View ab.log
ab -c 1 -n 1 https://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello
This is ApacheBench, Version 2.3 <$Revision: 1663405 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking hw9j2li3ma.execute-api.us-east-1.amazonaws.com (be patient)...SSL handshake failed (1).
10445:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-59/src/ssl/s23_clnt.c:593:
..done
View east_coast_nodejs_wrk.log
$ ./wrk -t 10 -c 50 -d 60s --latency --timeout 15s http://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello
Running 1m test @ http://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello
10 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.22ms 3.93ms 206.21ms 93.68%
Req/Sec 1.72k 366.83 2.19k 83.31%
Latency Distribution
50% 2.34ms
75% 2.59ms
90% 4.61ms
View TestUuidApplication.java
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import java.util.UUID;
public class TestUuidApplication extends Application<TestUuidConfiguration> {
@ryankennedy
ryankennedy / asplode.log
Created Sep 28, 2015
telemetry-example blowing up in Java 8
View asplode.log
WARN [2015-09-28 04:48:24,010] org.eclipse.jetty.server.AbstractConnector:
! java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: Could not initialize class java.lang.invoke.CallSite
! at sun.net.ExtendedOptionsImpl.<clinit>(ExtendedOptionsImpl.java:47) ~[na:1.8.0_20]
! at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.defaultOptions(SocketChannelImpl.java:241) ~[na:1.8.0_20]
! at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.<clinit>(SocketChannelImpl.java:228) ~[na:1.8.0_20]
! at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:250) ~[na:1.8.0_20]
! at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:169) ~[na:1.8.0_20]
! at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271) ~[na:1.8.0_20]
! at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:306) ~[na:1.8.0_20]
! at org.eclipse.jetty.server.AbstractConnector.configure(AbstractConnector.java:391) ~[jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312]
@ryankennedy
ryankennedy / BulkUpdate.java
Created Sep 11, 2015
Bulk re-enable SNS endpoints
View BulkUpdate.java
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.RegionUtils;
import com.amazonaws.services.sns.AmazonSNS;
import com.amazonaws.services.sns.AmazonSNSClient;
import com.amazonaws.services.sns.model.Endpoint;
import com.amazonaws.services.sns.model.ListEndpointsByPlatformApplicationRequest;
import com.amazonaws.services.sns.model.ListEndpointsByPlatformApplicationResult;
import com.amazonaws.services.sns.model.SetEndpointAttributesRequest;
import com.google.common.collect.ImmutableMap;
@ryankennedy
ryankennedy / output.txt
Created Sep 11, 2015
node trying to do substring on unicode
View output.txt
$ node substring.js 🙅🏿
🙅🏿.substring(0, 1) = �
🙅🏿.substring(0, 2) = 🙅
🙅🏿.substring(0, 3) = 🙅�
🙅🏿.substring(0, 4) = 🙅🏿
View gist:326671af8a6f6fe509c3
### Keybase proof
I hereby claim:
* I am ryankennedy on github.
* I am rckenned (https://keybase.io/rckenned) on keybase.
* I have a public key whose fingerprint is 85FC 20AA E092 3128 DBE7 61F6 5344 89C6 1213 23D0
To claim this, I am signing this object:
You can’t perform that action at this time.