Skip to content

Commit

Permalink
new buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Sep 15, 2014
1 parent dac8d05 commit 6bf9cd7
Show file tree
Hide file tree
Showing 50 changed files with 321 additions and 664 deletions.
33 changes: 33 additions & 0 deletions drafts/2014-09-16-Building-System-in-Clojure-1.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: post
title: "Building a System in Clojure - Part 1"
date: 2014-09-16 19:06
comments: true
categories:
---
This is the first of **n** articles about building **systems** in **[Clojure](http://clojure.org/)**. In this series we will be looking at the Clojure rewrite of and application I wrote last year: BirdWatch. This application subscribes to the Twitter Streaming API for all tweets that contain any of a number of terms and makes them searchable through storing them in ElasticSearch

Let's use a new demo, a term with a lot of traffic: **LOVE**. When tracking this term on the streaming API, I usually get around 75 tweets per second.

That's a lot, I wouldn't want to try opening that page on mobile, necessarily. But how about a live search in that stream? Let's filter out the tweets that contain the term birthday. With that, at the time of testing, I am down to two or three tweets per second:

http://localhost:8888/#birthday

Now if you are daring (and won't complain about bandwidth usage), why not go to the search field and click the search button with an empty field. Now you'll get all, which still works nicely and utilizes the CHrome helper so that it uses around 40% CPU on a quadcore 2012 retina macbook (where the available total is 800%, so it really only utilizes one virtual core to less than half). It would be interesting to simulate a higher load and see at how many messages per second Chrome maxes out the single JavaScript thread. One thing to note is that at around 50,000 tweets loaded, the application seems to come to a halt on the client side, with the server side unaffected. I suspect at one point I am currently just holding on to too much state. Let's check at some point if that's necessary for the specified functionality. I think not and I have an idea on how to solve this.

**Remove disconnected UIDs from mapping atom!**

Thanks and until next week,
Matthias

ARTICLE on the channels component
Channels are sweet. Bounded mailboxes are poison


Once we will have discussed the architecture in detail, next we can start observing the system under load. Of course, it would be interesting to have actual user load. But with or without actual load, we will want a way of generating / simulating load and then observe the system, identify the bottlenecks and remove them. For example the clients could be simulated by connecting a load generator via ZeroMQ or the like and deliver matches back to that application and check if they are as expected (correct, complete, timely). Also the Twitter stream could be simulated, for example by connecting to a load generator that either replays recorded tweets, with full control over the rate, or with artifical test cases, for which we could exactly specify the expectations on the output side.


footnotes:
I first discovered **Clojure** last summer and read quite a few articles on the language itself since. It wasn't until this summer though that I tried building an application with it. At first I was lost as to how I could structure an application in it. I started rewriting my **[BirdWatch](https://github.com/matthiasn/BirdWatch)** with Clojure on the server side and **ClojureScript** and **Om** on the client side. While that worked nicely, I ended up with something that I dreaded more than I dreaded the monsters under my bed when I was a kid and that was something where everything depended on everything. I have seen that too often to shrug it away and be okay with it.

Then I found Stuart Sierra's Component library and things started to look brighter again. It offers dependency injection, which, as I strongly believe, is crucial for building systems
20 changes: 6 additions & 14 deletions public/about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,28 +188,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
2 changes: 1 addition & 1 deletion public/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title><![CDATA[Matthias Nehlsen]]></title>
<link href="http://matthiasnehlsen.com/atom.xml" rel="self"/>
<link href="http://matthiasnehlsen.com/"/>
<updated>2014-09-11T17:08:04+02:00</updated>
<updated>2014-09-15T16:22:17+02:00</updated>
<id>http://matthiasnehlsen.com/</id>
<author>
<name><![CDATA[Matthias Nehlsen]]></name>
Expand Down
20 changes: 6 additions & 14 deletions public/blog/2013/04/19/hello-world/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,28 +270,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,28 +606,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
20 changes: 6 additions & 14 deletions public/blog/2013/04/26/data-model-upgrade/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,28 +541,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
20 changes: 6 additions & 14 deletions public/blog/2013/05/01/server-sent-events-vs-websockets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,28 +413,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,28 +265,20 @@ <h1>Recent Posts</h1>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li><a href="https://github.com/matthiasn/birdwatch">BirdWatch</a>
<li><a href="https://github.com/matthiasn/birdwatch/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/birdwatch#stargazers_count">BirdWatch</a>
<p>Reactive web application using Play Framework 2.2 for consuming and visualizing live Tweets from the Twitter Streaming API.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=birdwatch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-chat">sse-chat</a>
<li><a href="https://github.com/matthiasn/sse-chat/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/sse-chat#stargazers_count">sse-chat</a>
<p>Chat example app using Server Sent Events plus REST calls. Client side implementations both in AngularJS and in React.</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-chat&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/sse-perf">sse-perf</a>
<p>Reactive web application using Play Framework 2.1 for load testing Server Sent Event streams (or other HTTP connections that deliver information in chunks).</p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=sse-perf&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li><a href="https://github.com/matthiasn/Clojure-Resources">Clojure-Resources</a>&nbsp;
<li><a href="https://github.com/matthiasn/Clojure-Resources/" class="github-button" data-count-href="/ntkme/github-buttons/stargazers" data-count-api="/repos/matthiasn/Clojure-Resources#stargazers_count">Clojure-Resources</a>
<p>Compilation of useful links and resources for learning Clojure and ClojureScript </p>
<iframe src="http://ghbtns.com/github-btn.html?user=matthiasn&repo=Clojure-Resources&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
</ul>
</section>


<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<section>
<a name="signup"><h1>Subscribe</h1></a>
<div id="mc_embed_signup">
Expand Down
Loading

0 comments on commit 6bf9cd7

Please sign in to comment.