Skip to content

Instantly share code, notes, and snippets.

@gregoryyoung
gregoryyoung / gist:10451703
Created April 11, 2014 09:00
reuse connection
using System;
using System.Net;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using Newtonsoft.Json;
using EventStore.ClientAPI;
namespace Foo {
@gregoryyoung
gregoryyoung / gist:10535171
Created April 12, 2014 13:13
a bit on conferences
I think a bit is being missed in twitter largely due to space. I think what Hadi is trying to point out is the priorities associated.
Let's propose for a moment that we are a conference of 1000 people @ $400 each with 80 speakers (some will be local etc). From the rates discussed let's calculate quickly what T&E would come to 80*300 + 160*2*80 so 620 each over existing. If we were to do a quick calculation that comes out to roughly 50k.
I believe what Hadi was pointing out is that the conference has prioritized lower prices for attendees over paying T&E for speakers amortized over 1000 people the difference is rather insignificant from a ticket price POV ($50/ticket). Even if the numbers were a bit lower for attendees and the count lower with higher T&E it could be said that a 20% price increase could rather easily cover it (and 25% would double the hypothetical numbers above)
If this is not done there is a rather significant "donation" being made to a conference from the speakers. Not many speakers are wi
@gregoryyoung
gregoryyoung / gist:10595137
Created April 13, 2014 18:06
Event Store full atom reads
greg@orc:~/src/evhttp-sharp$ ab -k -n 5000000 -c 200 http://127.0.0.1:2113/streams/test-stream
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 500000 requests
Completed 1000000 requests
Completed 1500000 requests
Completed 2000000 requests
@gregoryyoung
gregoryyoung / gist:11053193
Created April 18, 2014 16:37
1m reads/10 threads (no client queuing)
[28650,06,16:35:35.288] 1000000 requests completed in 180581ms (5537.68 reqs per sec).
>>> fastest: 0
quintiles
20% : 0-0
40% : 0-0
60% : 0-1
80% : 1-1
100% : 1-80
90% : 1
curl http://127.0.0.1:2113/streams/newstream
{
"title": "Event stream 'newstream'",
"id": "http://127.0.0.1:2113/streams/newstream",
"updated": "2014-05-01T19:42:41.256511Z",
"streamId": "newstream",
"author": {
"name": "EventStore"
},
"headOfStream": true,
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.6 0 7
Processing: 1 4 1.1 4 16
Waiting: 1 4 1.1 4 16
Total: 3 5 1.1 4 16
WARNING: The median and mean for the initial connection time are not within a normal deviation
These results are probably not that reliable.
UMM I DONT CARE!
if(request.ip == knownip) {
if(popups.blockednormally) {
if(!tryPopupWithPostBack()) {
//possibly user
}
} else {
if(tryPopupWithPostBack()) {
//almost certainly user
}
}
First go to the head of the stream (in this case we are using the default chat of the chat sample)
greg@orc:~/src/EventStore$ curl -i http://127.0.0.1:2113/streams/chat-GeneralChat -H "Accept: application/json"
HTTP/1.1 200 OK
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER, Authorization, ES-LongPoll
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location, ES-Position
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept
@gregoryyoung
gregoryyoung / gist:a9e791e3a3be6fa635da
Created May 9, 2014 03:45
This is second chat with same rep.
06:12Brent R.: Thank you for contacting NHL support
06:13Greg: ok ill repeat myself I have been trying to buy gamecenter this evening and have been given a 500 response every time I try (before I enter paypal details). I am guessing a 500 error is likely a http 500 :)
06:14Brent R.: To confirm, you received the error code 500. And then registered a new www.nhl.com account, and you're receiving that code again?
06:14Greg: when I try to pay to watch games I receive a 500
06:15Greg: i would prefer to pay refreshing with dynamic ips is annoying
06:15Brent R.: If you are receiving the 'Error code 500' before entering your PayPal information, there may be an issue with your NHL.com. Please sign out of your current account at www.nhl.com , and then purchase a subscription with a new email address and username.
06:15Greg: I have already done this
06:15Greg: today
06:15Greg: your broken integration is really not my problem???
06:16Greg: I have money in my paypal. I want to give it to you. How do I do this?
greg@orc:~/src/EventStore.UI$ git reset --hard
HEAD is now at 00e2772 fixing issue with readme for master branch
greg@orc:~/src/EventStore.UI$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
greg@orc:~/src/EventStore.UI$ git pull --rebase origin dev
From github.com:EventStore/EventStore.UI
* branch dev -> FETCH_HEAD