<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ducksboard</title>
	<atom:link href="http://ducksboard.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ducksboard.com</link>
	<description>Real time dashboard for all your metrics.</description>
	<lastBuildDate>Wed, 19 Sep 2012 13:38:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Determine your top social media referrers</title>
		<link>http://ducksboard.com/blog/determine-your-top-social-media-referrers-mondaymetrics/</link>
		<comments>http://ducksboard.com/blog/determine-your-top-social-media-referrers-mondaymetrics/#comments</comments>
		<pubDate>Mon, 17 Sep 2012 18:24:00 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Social Media KPIs]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[social media conversions]]></category>
		<category><![CDATA[social media refererrs]]></category>
		<category><![CDATA[social media roi]]></category>
		<category><![CDATA[top sources]]></category>
		<category><![CDATA[web analytics]]></category>

		<guid isPermaLink="false">http://ducksboard.com/?post_type=post&#038;p=564</guid>
		<description><![CDATA[To keep up with the times, you´ve got to go social. And that´s all very well. Social Media is a great channel to attract new customers and drive repeat business. It´s no wonder this social frenzy has called for businesses to draw upon social networks. But before plunging into social mayhem, we have to know where [...]]]></description>
			<content:encoded><![CDATA[<p>To keep up with the times, you´ve got to go social. And that´s all very well. Social Media is a great channel to attract new customers and drive repeat business. It´s no wonder this social frenzy has called for businesses to draw upon social networks. But before plunging into social mayhem, we have to know where we´re actually going with our social media efforts.</p>
<p>Social Media may not quite be at it´s infancy anymore, but we´re still toddling around when it comes to social media measurement. Like any other investment, our social media performance must also be measured to determine our efficiency. To do so, it is important we establish goals which we wish to achieve through Social Media.</p>
<p>A good starting point is to measure our <strong>social media conversions</strong>. The number of likes and retweets are all very appealing, but at the end of the day the actions these people take from our social media efforts are what really matter. These actions, which we had better start calling conversions, can begin with a simple click.</p>
<p>We may be looking to raise brand awareness, drive sales by means of promotions, provide outstanding customer service or build on our customer´s loyalty, however, one thing is clear, social media will attract new audiences through word-of-mouth. The question is, how much social media traffic are you delivering to your site? Are your social media properties relevant traffic sources? <img src="http://ducksboard.com/wp-content/uploads/Screen-shot-2012-09-17-at-6.02.05-PM.png" alt="" title="Social Media Referrers" width="341" height="365" class="aligncenter size-full wp-image-561" /> </p>
<p>Your business´goals will give you a pretty good idea about which social media networks you should be engaging on. Each business and industry is different, which means some platforms will give your brand more traction than others depending on the audience and potential clients you wish to target. <strong>Segmenting your traffic will tell you exactly which social platforms are giving you better results, in other words, which social media platform is converting more social traffic.</strong></p>
<p>It´s important to track your social media referred traffic in your analytic data to determine if you´re reaching your defined objectives. Google Analytics provides an abundance of information at your fingertips, however, pinpointing what you need can sometimes lead to some frustration. Freeing up more time to focus on your other business needs is possible with a customized dashboard, where your web metrics and social media metrics are parsed to provide you with the information you need at a glance.<img src="http://ducksboard.com/wp-content/uploads/Screen-shot-2012-09-17-at-5.56.07-PM.png" alt="social media monitoring, web analytics, dashboard" title="Social Media ROI dashboard" width="1439" height="866" class="aligncenter size-full wp-image-560" /></p>
<p>This is just our first step into determining our Social Media ROI and the quality of traffic we´re sending. Are those visitors sticking around your site and are they doing what you intended? Watch this space for more Social Media KPIs. </p>
<p style="text-align: center;"><a href="https://app.ducksboard.com/signup/" class="button main_button little" onclick="_gaq.push(['_trackEvent', 'button', 'Click'])">Start your trial now and track your Web Analytics!</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/determine-your-top-social-media-referrers-mondaymetrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook attrition rate: likes me, likes me not.</title>
		<link>http://ducksboard.com/blog/facebook-attrition-rate/</link>
		<comments>http://ducksboard.com/blog/facebook-attrition-rate/#comments</comments>
		<pubDate>Mon, 10 Sep 2012 17:00:23 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Social Media KPIs]]></category>
		<category><![CDATA[attrition rate]]></category>
		<category><![CDATA[brand page]]></category>
		<category><![CDATA[community management]]></category>
		<category><![CDATA[community page]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[engagement]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook metrics]]></category>
		<category><![CDATA[facebook page]]></category>
		<category><![CDATA[fan page]]></category>
		<category><![CDATA[kpi]]></category>
		<category><![CDATA[likes]]></category>
		<category><![CDATA[social media monitoring]]></category>
		<category><![CDATA[unlike]]></category>
		<category><![CDATA[unlikes]]></category>

		<guid isPermaLink="false">http://ducksboard.com/?post_type=post&#038;p=529</guid>
		<description><![CDATA[We all get that feeling of satisfaction when the number of fans who like our Facebook Page keeps adding up. We feel we´re doing a good job when our community´s growth rate increases bit by bit. But surely the number of people who unclick our beloved like button has a lot to say for itself [...]]]></description>
			<content:encoded><![CDATA[<p>We all get that feeling of satisfaction when the number of fans who like our <a href="https://www.facebook.com/ducksboard">Facebook Page</a> keeps adding up. We feel we´re doing a good job when our community´s growth rate increases bit by bit. <strong>But surely the number of people who unclick our beloved like button has a lot to say for itself too.</strong></p>
<p>Managing a social community isn´t all about achieving likes. You´ve got to make sure you keep your users engaged and interested in what you have to share with them. They say love doesn´t last forever, and neither does one´s loyalty to your <em>fan page</em>. People change their minds, and it takes one click to <em>unlike</em> a page and be forever forgotten.  In the same way our success helps us on our way, our flops can also lead the way to improvement.</p>
<p>So what went wrong? Reports have it that 2 in every 5 people have no mercy, and they will rescind their like for your brand page because your brand no longer interests them, the content you generate is overbranded or it just doesn´t appeal to them anymore, you were publishing too much or maybe not publishing often enough. It´s hard to determine exactly why they´re leaving, but measuring your <strong>fan attrition</strong> rate will certainly give you a heads up.</p>
<p><a href="http://http://ducksboard.com/"><img class="aligncenter size-full wp-image-540" title="facebook-widget-attrition" src="http://ducksboard.com/wp-content/uploads/facebook-widget-attrition.png" alt="" width="1038" height="568" /></a></p>
<p>No matter how successful a brand page is, or how great it´s engagement is, we will always see a number of unlikes or unsubscriptions. This metric becomes relevant when we see spikes in the number of unlikes which need explaining. <strong>We can use this KPI to try and pinpoint why people are leaving our page and correlate this with the activity we are generating on our fanpage.</strong></p>
<p>Our <strong>Facebook Attrition</strong> widget fits in just perfectly in your Social Media Monitoring dashboard. It´s the perfect <strong>KPI</strong>  to evaluate your community management efforts and find out how many of your fans are leaving. Our peachy widget will help you visualize your percentual daily, weekly or monthly attrition rate. <strong>Things will be going well when your growth rate is more than your attrition rate. </strong></p>
<p>To calculate this nifty KPI, we use the following formula:</p>
<blockquote><p>Attrition rate =  unlikes / fan count (daily, weekly or monthly)</p></blockquote>
<p>You can also start measuring your attrition rate and many other trends and metrics on a very neat dashboard, by signing up on <a href="http://ducksboard.com/">Ducksboard</a>!</p>
<a href="https://app.ducksboard.com/signup/" class="button main_button little" onclick="_gaq.push(['_trackEvent', 'button', 'Click'])">Start your trial now and track your Facebook Page Insights!</a>
<p><a href="http://ducksboard.com/"><img class="aligncenter size-full wp-image-534" title="Screen shot 2012-09-10 at 12.31.23 PM" src="http://ducksboard.com/wp-content/uploads/Screen-shot-2012-09-10-at-12.31.23-PM2.png" alt="facebook, attrition, monitoring, social media, fans, widget, dashboard" width="875" height="593" /></a></p>
<p><a href="https://twitter.com/#!/search/%23mondaymetrics">#mondaymetrics</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/facebook-attrition-rate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing the Ducksboard API</title>
		<link>http://ducksboard.com/blog/ducksboard-api/</link>
		<comments>http://ducksboard.com/blog/ducksboard-api/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 15:31:47 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://blog.ducksboard.com/?p=281</guid>
		<description><![CDATA[We&#8217;ve been busy little ducklings as of late, working night shifts on things that were not visible to the user&#8217;s eye. Initially, Ducksboard launched with a push API that allowed users to send their own data and display them on their dashboards. Today we&#8217;re announcing a completely overhauled, comprehensive set of APIs that allow you [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been busy little ducklings as of late, working night shifts on things that were not visible to the user&#8217;s eye. Initially, Ducksboard launched with a push API that allowed users to send their own data and display them on their dashboards. Today we&#8217;re announcing a completely overhauled, comprehensive set of APIs that allow you to control every part of your dashboard from the comfort of your terminal with curl, or your browser with a Javascript engine.</p>
<p>The documentation is at <a title="Ducksboard API documentation" href="http://dev.ducksboard.com/apidoc/" target="_blank">http://dev.ducksboard.com/apidoc/</a>, go there if you want to get your feet wet or read on for a little backstory.</p>
<h2>Three is the number of APIs</h2>
<p>Having just <strong>one</strong> API was boring. So we went with three, each one providing access to a different part of Ducksboard. The previously existing Push API is now accompanied by the Pull API and the Dashboard API. These three APIs are actually all we use ourselves, together they&#8217;re sufficient to build your own alternative Ducksboard, if for some twisted reasons our visualizations are not good enough for you. Eating your own duck food is something we preach and practice.</p>
<h3><a title="Ducksboard Push API" href="http://dev.ducksboard.com/apidoc/push-api/" target="_blank">Push API</a></h3>
<p>You already know and love this one. It&#8217;s what you use to send data into Ducksboard, so your internal information can be shown alongside data obtained from other SaaS. It hasn&#8217;t changed, but the documentation got a facelift, make sure to check it out.</p>
<h3><a title="Ducksboard Pull API" href="http://dev.ducksboard.com/apidoc/pull-api/" target="_blank">Pull API</a></h3>
<p>For the Push API, we added a mirror Pull API that allows you to get back the data you sent, for the benefit of mobile apps, alternative visualizations or just to make sure we&#8217;re actually storing all that stuff. Whenever you see widgets filling themselves with data or lightening up when new information arrives, it&#8217;s using the Pull API.</p>
<p>Things get interesting when you realize that using the Pull API you can not only fetch information sent previously with the Push API, but also data that we gather from other services on your behalf. This means that if you&#8217;ve created a Zendesk widgets, you can get the data it&#8217;s displaying directly from the API. Same thing with New Relic, Twitter, Mailchimp and every single bit of information Ducksboard stores. Effectively, this converts Ducksboard into an API aggregator, transforming all the different APIs out there into a common format. The query to get the number of your Mailchimp subscribers looks the same as the query to get your app&#8217;s Apdex computed by New Relic.</p>
<p>There&#8217;s one more twist to the Pull API &#8211; it comes in two flavors. One is a typical REST service that you access <a title="Ducksboard HTTP Pull API" href="http://dev.ducksboard.com/apidoc/pull-api-http/" target="_blank">over HTTP</a>. The other one is <a title="Ducksboard WebSocket Pull API" href="http://dev.ducksboard.com/apidoc/pull-api-websocket/" target="_blank">WebSocket</a>, which means that you can connect any WebSocket client to Ducksboard and we&#8217;ll start sending you data as soon as we get it from the services we integrate. Since any modern browser nowadays is a WebSocket client, you can create a real-time Twitter client in no more than 50 lines of Javascript. We&#8217;re pretty excited by the possibilities, since as far as we know there&#8217;s very few open WebSocket servers out there.</p>
<h3><a title="Ducksboard Dashboard API" href="http://dev.ducksboard.com/apidoc/dashboard-api/" target="_blank">Dashboard API</a></h3>
<p>The last piece of the puzzle, creating widgets, dashboards and other objects that form Ducksboard is now possible via a REST API. Whenever you create a new widget, or move it around, or create a share link for a dashboard, you&#8217;re using the Dashboard API &#8211; that&#8217;s what our Javascript uses to communicate with the server side. With this API you have all the tools you need to automatically change widget colors or create new ones in response to events in your system.</p>
<h1>Caveat emptor</h1>
<p>There are lots of things that did not make it into the first release of the API. You&#8217;ll notice that when you create or modify widgets via API, the changes are not reflected immediately on your dashboard &#8211; you need to reload the page to see them. That&#8217;s a bit annoying and many times we thought about implementing that before going public with the API. In the end, we didn&#8217;t get around to doing it and as the saying goes, <strong>shipped is better than perfect</strong>. So that&#8217;s something that will come eventually, but for now please make judicious use of the F5 key.</p>
<p>The API is quite stable, but we still consider it beta. There are some loose ends and there probably are bugs. The documentation might have errors or typos. If you notice anything wrong with the API, please tell us at <a href="mailto:contact@ducksboard.com">contact@ducksboard.com</a> &#8211; we need your help to make this top-notch.</p>
<p>Have fun and may your curl strike true!</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/18300088.jpg"><img class="aligncenter  wp-image-290" title="Launching APIs" src="http://ducksboard.com/wp-content/uploads/18300088.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/ducksboard-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebSockets, Erlang and shattered glass</title>
		<link>http://ducksboard.com/blog/websockets-erlang-2/</link>
		<comments>http://ducksboard.com/blog/websockets-erlang-2/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 16:17:10 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://blog.ducksboard.com/?p=209</guid>
		<description><![CDATA[Here in our cozy nest at Ducksboard, we&#8217;re big fans of real-time. That&#8217;s why we&#8217;ve built our real-time business metrics dashboard using the latest and greatest of Web technology, namely WebSockets. Recently upgraded to the status of RFC, WebSockets describe a way for a web page to instantly deliver events to a connected browser. No [...]]]></description>
			<content:encoded><![CDATA[<p>Here in our cozy nest at <a title="Ducksboard" href="http://ducksboard.com" target="_blank">Ducksboard</a>, we&#8217;re big fans of real-time. That&#8217;s why we&#8217;ve built our real-time business metrics dashboard using the latest and greatest of Web technology, namely WebSockets. Recently upgraded to the status of <a title="RCF6455" href="http://tools.ietf.org/html/rfc6455" target="_blank">RFC</a>, WebSockets describe a way for a web page to instantly deliver events to a connected browser. No waiting, no polling, no delays.</p>
<p>While happily cranking out a nice mixture of unit tests and code, an idea dawned on us: will it <del><a title="Will it blend?" href="http://www.willitblend.com/" target="_blank">blend</a></del> scale? After all, thousands of users drawn by the sheer awesomeness emanating from our service will all connect and query our custom-built WebSockets server. This lead us to our old friend, a trusted and powerful stress testing tool, <a title="Tsung" href="http://tsung.erlang-projects.org/" target="_blank">Tsung</a>.</p>
<p style="text-align: center;"><img class="wp-image-213  aligncenter" title="Wave of Kanagawa" src="http://ducksboard.com/wp-content/uploads/wave-of-kanagawa.jpg" alt="Wave of Kanagawa" width="640" height="438" /></p>
<p class="wp-caption-text" style="margin: 0; text-align: center;">Wave of Kanagawa</p>
<h2></h2>
<h2>Putting the stress on real-time</h2>
<p>Tsung is a load testing program from <a title="Process-One" href="http://process-one.net/" target="_blank">Process-One</a>, the same folks that brought us the excellent ejabberd XMPP server (that alone is enough to consider them gods among men). Tsung can be used to generate load over various protocols, including HTTP, XMPP and PostgreSQL. It includes a bunch of nifty features, like distributed operation if you want to hammer your target from several machines, efficient generation of thousands of sessions courtesy of Erlang lightweight threads and a proxy recorder that can capture your application&#8217;s workload to produce more realistic test scenarios. You should definitely consider adding it to your toolbox.</p>
<p>Ducksboard&#8217;s frontend is two parts. The first one is a Django application, easy to test using the built-in Tsung HTTP capabilities. The second one is a WebSockets server, which cannot be easily stress tested. The existing projects that we tried did not work out of the box, included a bunch of features that were not really related to WebSockets or were not well documented. So we just went and wrote a WebSockets plugin for Tsung ourselves.</p>
<h2>Intermission: what&#8217;s with the glass, anyway?</h2>
<p>This post was supposed to be published last week. Actually, the bulk of the code you&#8217;ll see here has been written on planes and while waiting for delayed flights while we were making our way from the Ducksboard HQ in sunny Spain to SFO. Here&#8217;s yours truly in the Philadelphia waiting lounge, wondering where the heck did he put the Erlang OTP documentation he downloaded the day before.</p>
<p style="text-align: center; margin: 0px;"><img class="wp-image-214 aligncenter" title="Websocketin' @ Philly airport" src="http://ducksboard.com/wp-content/uploads/websockets-e1332707604129.jpg" alt="Websocketin' @ Philly airport" width="511" height="382" /></p>
<p class="wp-caption-text" style="margin: 0; text-align: center;">Websocketin&#8217; @ Philly airport</p>
<h2></h2>
<p>Sadly, it wasn&#8217;t long before we learned that even downtown San Francisco is not as safe as it looks. A momentary lapse of attention and the laptop that contained all of the Erlang code carefully written at 30,000 ft altitude was gone. After some commotion, a few phone calls and a visit to a SFPD station, the plugin got rewritten from scratch. I guess we should&#8217;ve stopped by at a Starbucks to push it to GitHub before going to dinner.</p>
<p><strong>Dear thieves</strong>: if you&#8217;re reading this, please send us a pull request with whatever details we missed when rewriting the code from memory. Toodles, <a title="Ducksboard Twitter" href="https://twitter.com/ducksboard" target="_blank">@ducksboard</a>.</p>
<p style="text-align: center; margin: 0px;"><img class="wp-image-215 aligncenter" title="Leaving your car unattended in SF" src="http://ducksboard.com/wp-content/uploads/breakin.jpg" alt="Leaving your car unattended in SF" width="512" height="383" /></p>
<p class="wp-caption-text" style="margin: 0; text-align: center;">Leaving your car unattended in SF</p>
<h2></h2>
<p>With that out of the way, let&#8217;s get back to WebSockets load testing.</p>
<h2>Arithmetic at a scale</h2>
<p>For demonstration purposes, let&#8217;s assume we have a simple <a title="Reverse Polish Notation" href="http://en.wikipedia.org/wiki/Reverse_Polish_notation" target="_blank">RPN</a> calculator that can be reached over WebSockets. Since we like terse, readable syntax we&#8217;ll use JSON and since we like security, we&#8217;ll use encrypted communication.</p>
<p>The service works like this: all messages from client to server are JSON objects with a &#8220;msg&#8221; key. After connecting you send a &#8220;uuid&#8221; message and the server responds with a calculation key. Once you got some of these, you can send &#8220;push&#8221; messages with your key and a token. The tokens can be arithmetic operators or numbers, and they get pushed on a stack. Once you have the stack ready, you send a &#8220;compute&#8221; message and get back the result. The protocol is completely artificial, it&#8217;s just a showcase for some of the more interesting features of Tsung.</p>
<p>An example session for our service would be:</p>
<blockquote style="font-size: 14px;">
<pre>* client #1 connected
  #1 --&gt; {"msg": "uuid"}
  #1 &lt;-- {"uuid": "&lt;uuid&gt;"}
  #1 --&gt; {"msg": "push", "token": 2, "uuid": "&lt;uuid&gt;"}
  #1 --&gt; {"msg": "push", "token": 3, "uuid": "&lt;uuid&gt;"}
  #1 --&gt; {"msg": "push", "token": "+", "uuid": "&lt;uuid&gt;"}
  #1 --&gt; {"msg": "compute", "uuid": "&lt;uuid&gt;"}
  #1 &lt;-- {"result": 5.0}
* client #1 disconnected</pre>
</blockquote>
<p>We will stress test this service using a modified Tsung version.</p>
<h2>Anatomy of a Tsung plugin</h2>
<p>The complete code for this post is at <a title="Github repository for Tsung Websockets" href="https://github.com/wulczer/tsung_ws" target="_blank">https://github.com/wulczer/tsung_ws</a>. Check out that repository and follow the instructions in the README to get you started. Be aware that the code there is the first foray of yours truly into the exciting world of Erlang, so it might make your eyes pop out. It does the job though, and has quite a few comments. You will end up with a modified version of Tsung that&#8217;s capable of talking to WebSockets servers.</p>
<p>Writing a Tsung plugin is fairly easy and there&#8217;s a tutorial available over at their <a title="Tsung wiki" href="http://www.process-one.net/en/wiki/Writing_a_Tsung_plugin/" target="_blank">wiki</a>. Configuration for a Tsung test run is an XML file, so first you modify the DTD to add your session type. In our case, that means adding support for a &lt;websocket&gt; tags. The plugin supports four kinds of requests:</p>
<ul>
<li>opening a HTTP connection and switching the protocol to WebSockets</li>
<li>sending WebSockets data, optionally waiting for the server to respond</li>
<li>sending pings</li>
<li>closing the connection</li>
</ul>
<p>Read the websocket.xml file included in the repository to get a hang of how you&#8217;d combine them to define WebSockets workload.</p>
<p>Once you have the DTD ready, you write two Erlang modules, one that&#8217;s responsible for parsing the XML into data structures that Tsung uses and another one that deals with interpreting bytes coming on the wire and generating bytes to send back. It all comes down to implementing two functions.</p>
<h6>get_message</h6>
<p>This function gets passed a structure previously created when parsing the XML and another one describing the current connection state. Its job is to return a binary string that will be sent on the wire and a new connection state. Typically, this function will look at the type of request you want to do and generate a protocol message. For instance, if for  &#8220;send&#8221; requests, get_message will fetch the content of the &lt;websocket&gt; tag, serialize it as a WebSockets frame and return it. By default, Tsung expects data sent to the server to be &#8220;acknowledged&#8221;. This means that the session will not continue until the parse function decides that it&#8217;s OK to do so. That&#8217;s useful for protocols like HTTP where you typically send a request and wait for the server to return a HTTP code before proceeding. In WebSockets, you might want to send something off and continue without any kind of confirmation from the server, so you can mark requests as &#8220;no_ack&#8221;. See the comments in the example XML file for details.</p>
<h6>parse</h6>
<p>This function gets passed a binary string received on the wire and the connection state and returns the new state and a few other connection-related things. Its main purpose is to mark the current session as ackowledged, as explained above. In our case, depending on the state of the session, the parse function will either wait for the initial HTTP protocol switching to finish or parse incoming data as WebSocket frames.</p>
<p>There&#8217;s a few other functions you need to implement, you might need to read the comments in ts_websocket.erl to get a feeling of what they do.</p>
<p>The repository includes a simple <a title="Twisted" href="http://twistedmatrix.com/" target="_blank">Twisted</a> implementation of the aforementioned service and an example Tsung configuration file. Check out the comments inside it to get a hang of how you would configure Tsung for your own service. If you&#8217;re curious about how the output looks like, it&#8217;s available for your perusal <a title="Tsung report" href="http://dl.dropbox.com/u/18475267/tsung-report/graph.html" target="_blank">here</a>. Of course it&#8217;s just an example, in reality you&#8217;d never generate the load on the same machine that accepts it.</p>
<p>As you can see, you get a few graphs showing the connection rate, network throughput and concurrent client numbers, as well as a short summary of any errors and timeouts.</p>
<h2>Flap the beak with us!</h2>
<p>That concludes our brief tour through the wonderful world of real-time Web protocols, Erlang, load testing and street delinquency. Did this post provide some morning entertainment to go with the coffee? Perhaps you found informative, or even helpful? We&#8217;re in the Bay Area until the 6th of April, if you know a place where you can get real black coffee and want to have a chat, shoot a mail to <a title="Ducksboard contact email" href="mailto:contact@ducksboard.com" target="_blank">contact@ducksboard.com</a> or reach out via Twitter at <a title="Ducksboard Twitter" href="https://twitter.com/ducksboard" target="_blank">@ducksboard</a>. See you!</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/websockets-erlang-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Announcing the hackathon results</title>
		<link>http://ducksboard.com/blog/hackathon-results/</link>
		<comments>http://ducksboard.com/blog/hackathon-results/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 17:01:28 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[API rest]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[hackaton]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=173</guid>
		<description><![CDATA[We&#8217;re very happy to announce that the first Ducksboard hackathon has officially concluded. We&#8217;d like to thank all the participants and the people who voted for the best projects on our hackathon page. We had lots of fun looking at what you&#8217;ve created using our API and we hope you enjoyed yourselves as well. If [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re very happy to announce that the first <a title="Ducksboard hackathon!" href="http://ducks.wpengine.com/2011/10/lets-make-a-distributed-hackathon/">Ducksboard hackathon</a> has officially concluded. We&#8217;d like to thank all the participants and the people who voted for the best projects on our hackathon page. We had lots of fun looking at what you&#8217;ve created using our API and we hope you enjoyed yourselves as well.</p>
<p>If you&#8217;re curious about what people have built, visit our <a title="Hackaton results page" href="http://hackathon.ducksboard.com/">results page</a> and browse the submissions.</p>
<p>And now, without further ado, the results!</p>
<p><strong>The winner of the Public Vote and a $100 Amazon gift card is:</strong></p>
<p>A <a href="https://public.ducksboard.com/K0V6yWKx0W8AOQ-OuSCY/" target="_blank">dashboard visualizing the upcoming Spanish parliamentary elections</a>. It even sports photos of the principal candidates with QR codes that you can scan and the dashboard will count your vote!</p>
<p style="text-align: center;"><a href="https://public.ducksboard.com/K0V6yWKx0W8AOQ-OuSCY/"><img class="aligncenter size-medium wp-image-176" title="hackathon-spanishelections" src="http://ducksboard.com/wp-content/uploads/hackathon-spanishelections-282x300.png" alt="" width="282" height="300" /></a></p>
<p>Several people were watching this dashboard at last night&#8217;s debate between the two politicians spun the Spanish Twitter into a frenzy, giving us reasons for both pride and terror as the number of updates we were delivering surpassed 200 per second. Fortunately, we managed through it unscathed. If you want to see a fun visualisation of our traffic on that night, <a href="http://www.youtube.com/watch?v=7_9R8rWWdGk" target="_blank">take a look at this video</a>.</p>
<p><strong>The runner-up and the winner of a $300 Amazon gift card is:</strong></p>
<p>A <a href="https://public.ducksboard.com/2tcyHoO9-aqckWTjznlm/" target="_blank">dashboard tracking the position and ephemerides of the International Space Station</a>.</p>
<p style="text-align: center;"><a href="https://public.ducksboard.com/2tcyHoO9-aqckWTjznlm/"><img class="aligncenter size-medium wp-image-177" title="hackathon-iss" src="http://ducksboard.com/wp-content/uploads/hackathon-iss-300x196.png" alt="" width="300" height="196" /></a></p>
<p>We loved the novelty of the idea, the geeky twist (space stations!) and the comprehensiveness of information shown. The often-updating image of the station&#8217;s current position gives it a nice finishing touch. I&#8217;m sure that next week some ducks will be pointing binoculars at the sky, while glancing at the dashboard to make sure we know when it&#8217;s coming. Maybe we need to add Night Mode so you can use Ducksboard without ruining your <a href="http://en.wikipedia.org/wiki/Adaptation_%28eye%29" target="_blank">dark adaptation</a>?</p>
<p><strong>Finally, the winner of the first Ducksboard hackathon and a $500 Amazon gift card is:</strong></p>
<p>A <a href="https://public.ducksboard.com/4p2wevyDlQBlTFeui_Q5/" target="_blank">dashboard for kayak aficionados</a> (powered by <a href="http://golang.org" target="_blank">Go</a> - <a href="https://github.com/jswank/streamfeed" target="_blank">Github repo</a>)</p>
<p style="text-align: center;"><a href="https://public.ducksboard.com/4p2wevyDlQBlTFeui_Q5/"><img class="aligncenter size-medium wp-image-178" title="hackathon-streamfeed" src="http://ducksboard.com/wp-content/uploads/hackathon-streamfeed-300x186.png" alt="" width="300" height="186" /></a></p>
<p>Innovative, ingenious and downright useful. This dashboard goes a long way to demonstrate how with relative ease you can whip out something that can help you plan your next kayak escapade. We feel that it&#8217;s one of the things technology is about: making everyday life a little bit easier. It was also nice to see the code behind the dashboard and how clean and simple it turned out to be. At least one of us has taken a sound resolve to play with go (the language, not the <a href="http://en.wikipedia.org/wiki/Go_%28game%29" target="_blank">game</a>, although one of the developers can sometimes be seen with a box of black and white stones) in the near future.</p>
<p>So that&#8217;s it! It&#8217;s been a tough decision as there are many other ingenious, surprising and fun projects that we liked a lot. Thank you all for participating, voting and for your interest and I hope we can have another such event sometime in the future. Congratulations for the winners and remember that everyone who participated gets free usage of the push API once we start charging for the service.</p>
<p>Until next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/hackathon-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s make a distributed hackathon!</title>
		<link>http://ducksboard.com/blog/distributed-hackathon/</link>
		<comments>http://ducksboard.com/blog/distributed-hackathon/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 16:42:00 +0000</pubDate>
		<dc:creator>diego</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=139</guid>
		<description><![CDATA[What&#8217;s all the fuss about? At Ducksboard, we believe in push. We believe that polling is passé. We believe that coming around every five seconds and asking what&#8217;s up is not something a polite person would do. We&#8217;re in the business of making online dashboards for digital empires and we like instant updates much more [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What&#8217;s all the fuss about?</strong></p>
<p>At <strong><a href="http://ducksboard.com" target="_blank">Ducksboard</a></strong>, we believe in push. We believe that polling is passé. We believe that coming around every five seconds and asking what&#8217;s up is not something a polite person would do. We&#8217;re in the business of making online dashboards for digital empires and we like instant updates much more than constant page reloads.</p>
<p>So we&#8217;ve built our entire product around WebSockets and we&#8217;re using push interfaces wherever possible. The API we provide gives users a dead easy way to instantly publish data to our dashboard. Now we want *you* to give it a spin and try to build something awesome with it.</p>
<p style="text-align: center;"><a href="http://ducksboard.com"><img class="aligncenter size-full wp-image-156" title="ducks-3screens-600px" src="http://ducksboard.com/wp-content/uploads/ducks-3screens-600px.png" alt="" width="600" height="357" /></a></p>
<p><strong>Enter the Ducksboard hackathon.<br />
</strong></p>
<p>Hackawhat?</p>
<p>Hackathon. The whole idea was born when we saw a tweet from a guy that took to playing with our API. Apparently one of the best uses of an online dashboard powered by WebSockets is tracking your Domino&#8217;s pizza delivery in real time (we agree, lets you perfectly time taking the beers out of the freezer). See the video that we thought was rather cool:</p>
<p><a href="http://ducksboard.com/blog/distributed-hackathon/"><em>Click here to view the embedded video.</em></a></p>
<p><strong>So how does this work?<br />
</strong><br />
Simple, you can get started in literally 10 minutes. Email or DM us and we&#8217;ll set you up with an account. Read the <a href="https://ducksboard.jira.com/wiki/display/API" target="_blank">API documentation</a>, take a look at the <a href="https://github.com/ducksboard/api-examples" target="_blank">examples</a> and make something fun. Publish your dashboard and brag about it. On <strong>Monday the 7th of November at 10:00 UTC</strong> we&#8217;ll look at the dashboards you created and choose the winners.</p>
<p><strong>If there are winners, does it mean there are prizes?</strong></p>
<p>Sure. Here&#8217;s what you can aim for:</p>
<ul>
<li>1st prize: a $500 Amazon gift card</li>
<li>2nd prize: a $300 Amazon gift card</li>
<li>Popular vote winner:  a $100 Amazon gift card</li>
</ul>
<p>Additionally, once paid plans are out, *anyone* who manages to make something cool and working gets push API usage included for free during several months. We&#8217;ll just forget to send you an invoice.</p>
<p><strong>Whoa, aren&#8217;t you just trying to squeeze free PR out of me?</strong></p>
<p>Let&#8217;s clear this up straight away. We&#8217;re building an online service that will eventually cost money to use. A significant part of the value we&#8217;re offering is our push API. Once we start charging for the service, all participants that made a significant contribution (pizza-delivery tracking *definitely* counts as significant in our book) will be able access the push API for free several months.</p>
<p>In a way, it *is* a publicity stunt, but at its core lies the desire to have fun, play with cutting-edge technology, make interesting things and just hack.</p>
<p><strong>What kind of things can I build?</strong></p>
<p>Essentially, whatever you want. Here are <a href="https://github.com/ducksboard/api-examples" target="_blank">a few examples</a> we came up on a Sunday afternoon, each took no more than a couple of hours to implement. The source code for everything is on our GitHub.</p>
<blockquote><p><strong>Who&#8217;s there?</strong></p>
<p>A Python script that detect how many people are sitting in front of a webcam and sends that info to Ducksboard. Here&#8217;s an example of how if looks on the dashboard.</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/face-recognition-0.png"><img class="aligncenter  wp-image-164" title="face-recognition-0" src="http://ducksboard.com/wp-content/uploads/face-recognition-0.png" alt="" width="612" height="334" /></a></p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/face-recognition-2.png"><img class="aligncenter  wp-image-163" title="face-recognition-2" src="http://ducksboard.com/wp-content/uploads/face-recognition-2.png" alt="" width="612" height="329" /></a></p>
<p>We have to admit it tends to work great, except for an occasional glitch <img src='http://ducksboard.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/face-recognition-bird.png"><img class="aligncenter  wp-image-161" title="face-recognition-bird" src="http://ducksboard.com/wp-content/uploads/face-recognition-bird.png" alt="" width="612" height="333" /></a></p>
</blockquote>
<blockquote><p><strong>Emacs integration</strong></p>
<p>No software is complete until it integrates with Emacs. This package allows you to send Ducksboard events when you open/edit/close files and graphs the number of keystrokes you make over time. Here&#8217;s a screenshot of how it works.</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/ducks-emacs.png"><img class="aligncenter size-full wp-image-150" title="ducks-emacs" src="http://ducksboard.com/wp-content/uploads/ducks-emacs.png" alt="" width="542" height="283" /></a></p>
</blockquote>
<blockquote><p><strong>Desktop/webcam grabber</strong></p>
<p>Grabs a screenshot of your desktop or a still frame from your laptop&#8217;s camera and uploads it do Ducksboard. For best results connect to a webcam pointing at the office snacks box so you can be the first to get there when it gets replenished. Requires OpenCV to use the camera and GTK to grab the desktop.</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/widget-screenshot.png"><img class="aligncenter size-full wp-image-166" title="widget-screenshot" src="http://ducksboard.com/wp-content/uploads/widget-screenshot.png" alt="" width="347" height="371" /></a></p>
</blockquote>
<blockquote><p><strong>(Mis)adventures in bash</strong></p>
<p>A shell script written by our CEO. Proof that Ducksboard&#8217;s API is so easy even someone who dropped out from both CS and Business School can use it. Clears the terminal before running, because &#8220;we Mac people care about user experience&#8221;. The most terrifying thing about it is that it actually works!</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/bash_terminal_screenshot.png"><img class="aligncenter size-full wp-image-148" title="bash_terminal_screenshot" src="http://ducksboard.com/wp-content/uploads/bash_terminal_screenshot.png" alt="" width="563" height="365" /></a></p>
</blockquote>
<p><strong>More to come!</strong></p>
<p>We&#8217;ll be participating too! We&#8217;ll be answering questions, coming up with more examples and fixing any bugs that might rear their ugly heads. See the communication section below for contact info in case you have questions or problems.</p>
<p><strong>Resources</strong></p>
<blockquote><p><strong>Communication:</strong></p>
<ul>
<li><strong><a href="http://groups.google.com/group/ducks-hackathon" target="_blank">Google Group</a></strong> (*recommended*)</li>
<li><strong><a href="mailto:contact_at_ducksboard_dot_com" target="_blank">email</a></strong></li>
<li><strong><a href="http://twitter.com/ducksboard" target="_blank">Twitter</a></strong></li>
<li><strong>#ducks-hackathon</strong> on irc.freenode</li>
</ul>
<p><strong><a href="https://ducksboard.jira.com/wiki/display/API/" target="_blank">API documentation</a></strong><br />
<strong><a href="http://ducksboard.com/hackathon" target="_blank">List of submissions</a></strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/distributed-hackathon/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Runtime code modification. Erlang? No, Python.</title>
		<link>http://ducksboard.com/blog/runtime-code-modification-erlang-python/</link>
		<comments>http://ducksboard.com/blog/runtime-code-modification-erlang-python/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 14:21:39 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=111</guid>
		<description><![CDATA[Here at Ducksboard we have a seriously bad engineer. While most of us are inspired hackers, there is this one individual that many a time uploaded code to production servers which resulted in woe, tears and widespread breakage. Luckily, we have a secret weapon: the ability to change our server code in runtime. Here&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Here at <strong><a href="http://ducksboard.com" target="_blank">Ducksboard</a></strong> we have a seriously bad engineer. While most of us are inspired hackers, there is this one individual that many a time uploaded code to production servers which resulted in woe, tears and widespread breakage. Luckily, we have a secret weapon: the ability to change our server code in runtime. Here&#8217;s a story.</p>
<p>A few days ago, alarm bells sounded. The machine load values were crazy, memory consumption was skyrocketing, disaster loomed. I started investigating and it turned out that our data gathering service, the one responsible for fetching values from upstream APIs and pushing them to your dashboard was rabidly launching thousands of requests every minute. Soon enough I found the issue: a timeout value that was set way too low, courtesy of Bad Engineer who wanted instant feedback while testing and forgot to set it back before pushing the code. Oh, Bad Engineer, you naughty joker, what am I to do? Change the timeout and restart the service? Dark thoughts of downtime came upon me. I didn&#8217;t want to stop production services just to fix a silly typo and then it struck me. I could just SSH into the service and change the value in the running process. Then during the next scheduled deployment it would get corrected for good.</p>
<div id="attachment_113" class="wp-caption aligncenter" style="width: 650px"><a href="http://ducksboard.com/wp-content/uploads/3736320505_0caaf02328_z.jpg"><img class="size-full wp-image-113 " title="3736320505_0caaf02328_z" src="http://ducksboard.com/wp-content/uploads/3736320505_0caaf02328_z.jpg" alt="manhole" width="640" height="421" /></a><p class="wp-caption-text">Man walking into manhole, by DominusVobiscum</p></div>
<p>All of our services have a <a title="Manhole API docs" href="http://twistedmatrix.com/documents/11.0.0/api/twisted.manhole.html">Twisted manhole</a> running. Manhole is a way to make a Twisted daemon accept connections and give you a Python shell <strong>inside</strong> the process. You get full access to all the objects inside the service, you can call methods, change attributes and generally do everything you like. For example, fix a timeout variable and restart everything that&#8217;s using it with a fixed value. Which is exactly what I did and it went like this:</p>
<pre>server$ ssh -p XXX localhost
&gt;&gt;&gt; http.resource.service.managers[0]
&lt;ducksboard.parsers.manager.ParserManager object at 0xa4fbccc&gt;
&gt;&gt;&gt; # let's see the timeout value
&gt;&gt;&gt; http.resource.service.managers[0].parse_interval
5
&gt;&gt;&gt; # five seconds, way to go Bad Engineer! time to fix this, first fix the class variable
&gt;&gt;&gt; http.resource.service.managers[0].__class__.DEFAULT_PARSE_INTERVAL = 5 * 60
&gt;&gt;&gt; # then fix the value in objects that were already created
&gt;&gt;&gt; for manager in http.resource.service.managers:
...     manager.parse_interval = 5 * 60
...     manager.stop_parsing()
...     manager.start_parsing()
...
&gt;&gt;&gt; # we're done! exit the Python shell
&gt;&gt;&gt; ^D
server$</pre>
<p>As easy as that. Note how we used the plain ssh command to connect to the service. Underneath, a public key authentication happened, using ssh-agent running locally on my machine. As with most Twisted components, you can plug in your own authentication mechanism and your own permissions mechanism. You can expose only parts of the running process to the connecting party or you can do it on a per-user basis, so that Bad Engineer will not be able to access the ParserManagers. You can even hook it up to a WebSocket protocol and be able to debug your processes in runtime through your browser! Manhole is just one of these gems that people often don&#8217;t know about and that deserves much more publicity than it gets (you could say the same about the Twisted project, I guess).</p>
<p>With manhole you can run debugging scripts that dump internal data structures, count objects to detect memory leaks, produce values for your reporting system or, when things go south, just SSH into your process and fix it up. Oh, and Bad Engineer? It&#8217;s actually me. After all, we all have bad days and at least I was able to clean up my own mess!</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/runtime-code-modification-erlang-python/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Ducksboard: from nothing to private beta in four months</title>
		<link>http://ducksboard.com/blog/ducksboard-from-nothing-to-private-beta-in-four-months/</link>
		<comments>http://ducksboard.com/blog/ducksboard-from-nothing-to-private-beta-in-four-months/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 16:42:28 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Startup]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=93</guid>
		<description><![CDATA[It&#8217;s done. Ducksboard has entered private beta. The four months from drawing the first lines on a piece of paper to flipping DNS entries at 6AM have been a fun ride. Go see the homepage and play around with the demo or read on about some of our experiences. Ducksboard is a real-time dashboard for [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s done. <a title="Ducksboard" href="http://ducksboard.com/" target="_blank">Ducksboard</a> has entered private beta. The four months from drawing the first lines on a piece of paper to flipping DNS entries at 6AM have been a fun ride. Go see the <a title="Ducksboard homepage" href="http://ducksboard.com/" target="_blank">homepage</a> and play around with the <a title="Ducksboard demo" href="https://demo.ducksboard.com/demo/" target="_blank">demo</a> or read on about some of our experiences.</p>
<p>Ducksboard is a real-time dashboard for tracking your internal metrics and webservices. A single place where you can gather data from all SaaS apps you use (GoogleAnalytics, Mailchimp, Sendgrid, Zendesk&#8230;), as well as pushing us any internal metric you might consider through our REST API.</p>
<p style="text-align: center;"><a href="http://ducksboard.com"><img class="aligncenter size-full wp-image-97" title="ducksboard_mbp" src="http://ducksboard.com/wp-content/uploads/ducksboard_mbp1.png" alt="" width="500" height="322" /></a></p>
<h2>A walk through the architecture</h2>
<p>(a very brief one)</p>
<p>Most of the original design sketched at the beginning has survived, which might be a concidence or the effect of choosing simple interfaces and deciding to go with technologies we already knew. All of our backend is Python and we make heavy use of <a title="Twisted" href="http://twistedmatrix.com/" target="_blank">Twisted</a>. Persistent storage is provided by <a title="PostgreSQL" href="http://postgresql.org/" target="_blank">PostgreSQL</a> and realtime updates are pushed to <a title="RabbitMQ" href="http://rabbitmq.com/" target="_blank">RabbitMQ</a> and delivered to clients through WebSockets. We have almost 17,000 lines of Python code, 10,000 of which are tests. Our unit tests coverage oscillates around 98% and in a few days we hope we&#8217;ll be pushing it back to 100%.</p>
<p>A common concern throughout the whole project was security. We care about security and we&#8217;re serious about it. We try to cover all our bases and we&#8217;re considering hiring outside penetration testers to make sure our customer&#8217;s data is safe. We use SSL between the backend and the database, between the backend and the queue and for the entire frontend. We check for certificate validity. We use <a title="How to safely store a password" href="http://codahale.com/how-to-safely-store-a-password/">bcrypt</a> to store customer&#8217;s passwords, use symmetric encryption to scramble customer&#8217;s API tokens and encrypt our database backups.</p>
<p>Another point worth mentioning is Open Source. We&#8217;re using lots of open source, which today never surprises anyone. However, stopping to think about it, the amount of raw functionality and saved time we get from projects like jQuery, txamqp, txWebSocket, countless Python packages from PyPI, not to mention the database software, queue software, the editors we use (yes, one of us uses One Editor, the other one uses The Other Editor) and finally the operating system our servers and desktops run is *amazing*. Open Source is a phenomenon that never ceases to amaze me. We have identified parts of our code that are generic enough to be reusable by other people and we will soon publish them with a liberal license and we are deeply thankful to all the people whose code powers Ducksboard in its everyday tasks.</p>
<p>The architecture really deserves a longer post (and a more serious one than <a href="http://ducks.wpengine.com/2011/03/ducksboard-design/" target="_blank">the last one</a>) which we&#8217;ll try to put together in a few weeks.</p>
<h2>Good decisions</h2>
<h3>Start gathering emails from interested people from day one</h3>
<p>The rate of new signups served as a constant validation, reassuring us that there is demand for what we were making. We asked the people from that email list for some early feedback that helped us take product decitions at early stages. The last poll we did has been filled by +700 people.</p>
<h3>Create an interactive teaser page</h3>
<p>Software development is like playing frisbee, you should never say anything else than &#8220;hey, look!&#8221;. Our first appearance on the Internet has been a realtime Twitter timeline, deployed using our own software. It gave us a first glimpse at how well do we scale and forced us to document the deployment process. The timeline was tracking mentions of our Twitter account, which encouraged users to tweet something about us to see the message appearing. That gave a nice viral touch to the teaser.</p>
<h3>Hire a top-notch UX dexigner</h3>
<p>We&#8217;re a startup and we&#8217;re bootstrapping. Every dollar (actually, every euro) spent means one day less before we run out of juice. It was a difficult decision but we knew that you sell a dashboard throught the eyes. It turned out to be by far the best investment we did (maybe after NBA2K11 for the Xbox <img src='http://ducksboard.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). We are completely in love with the design of our dashboard and we are hearing similar opinions for people all over.</p>
<h2>Not so good decisions</h2>
<p>(also known as bad decisions)</p>
<h3>Optimistic estimation for the front-end</h3>
<p>We thought this wasn&#8217;t gonna happen to us… But it happened. It&#8217;s really hard to make good estimations when you are using fringe technologies (WebSockets, anyone?) and you have to test it in several browsers and devices. We&#8217;re server people, Javascript is not our strongest point and our application  is definitely Javascript heavy. We already decided our first hire will be a front-end engineer. If you are interested, please <a href="http://ducksboard.com/contact/" target="_blank">contact us</a>.</p>
<h3>Delaying front-end development until we have finished the backend</h3>
<p>Writing network servers is so much fun you forget you need to deliver something a browser can render and execute. We thought it was as easy as turning the HTML into templates and connecting the frontend through our internal API… but as the frontend took shape it made us realise we needed several changes to our original design and the damn HTML never rendered as it should. We ended up with a backend we&#8217;re very happy with and a frontend that could definitely use some cleanup.</p>
<p>Hopfully you found some of that useful. Expect to hear from us soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/ducksboard-from-nothing-to-private-beta-in-four-months/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Experiences from launching a teaser page on HN</title>
		<link>http://ducksboard.com/blog/launching-teaser-page-haker-news/</link>
		<comments>http://ducksboard.com/blog/launching-teaser-page-haker-news/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 14:30:37 +0000</pubDate>
		<dc:creator>Aitor</dc:creator>
				<category><![CDATA[Startup]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=64</guid>
		<description><![CDATA[Yesterday was a pretty hectic day at the ducks&#8217; nest: we launched our teaser page! There were many reasons why launching the teaser was interesting to us: the real time Twitter timeline used is powered by our Ducksboard backend, being its first real world test. it&#8217;s a fantastic way of measuring the interest generated by [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday was a pretty hectic day at the ducks&#8217; nest: we launched our <a href="http://ducksboard.com/" target="_blank">teaser page</a>!</p>
<p>There were many reasons why launching the teaser was interesting to us:</p>
<ul>
<li>the real time Twitter timeline used is powered by our Ducksboard backend, being its first real world test.</li>
<li>it&#8217;s a fantastic way of measuring the interest generated by our product in the form of subscriptions to our beta.</li>
<li>it&#8217;s a good oportunity to make it to the <a href="http://news.ycombinator.com/" target="_blank">Hacker News</a> frontpage <img src='http://ducksboard.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>All in all the experience has been very positive: 24 hours after, we have gathered hundreds of requests for the beta program, have had thousands of unique visitors checking out the page and have accumulated more than 200 followers on <a href="http://twitter.com/ducksboard" target="_blank">Twitter</a>. Some moments weren&#8217;t that funny as bugs and problems, of course, appeared.</p>
<p>Here is a selection of the strongest memories and experiences I built yesterday:</p>
<p><strong>If you are launching anything online, get real time statistics</strong></p>
<p>The most exciting moments took place when the team gathered around a 40&#8243; TV to look at our <a href="http://www.woopra.com/">Woopra</a> client update in real time the avalanche of visitors. Numbers going up and world maps showing a lot of activity are the best part of launches <img src='http://ducksboard.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/woopra_teaser.jpg"><img class="aligncenter size-full wp-image-78" title="Woopra teaser" src="http://ducksboard.com/wp-content/uploads/woopra_teaser.jpg" alt="Woopra teaser" width="480" height="359" /></a></p>
<p><strong>Don&#8217;t EVER update live code if it&#8217;s not 100% necessary</strong></p>
<p>Yeah, I know, it&#8217;s so obvious it&#8217;s not even worth mentioning, but we (I) did it. We launched the teaser and soon realized that it would be nice to have the tweets in the timeline actually link to Twitter. I updated the javascript involved, tested it on my machine, uploaded it to the server, and&#8230; broke the teaser. We were too excited to think clearly, I guess. I rollbacked and everything went back to normal, but some visitors found a broken teaser page&#8230; My excuses! Damn, I had a bad moment!</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/broken_teaser.png"><img class="aligncenter size-full wp-image-76" title="Broken teaser" src="http://ducksboard.com/wp-content/uploads/broken_teaser.png" alt="Broken teaser" width="480" height="140" /></a></p>
<p><strong>Tease, it&#8217;s a teaser!</strong></p>
<p>It wasn&#8217;t until few minutes before the launch that we decided to add some screenshots of the product WIP frontend. We are now convinced that it was the right choice. Saying &#8220;we are building a beautiful real time dashboard&#8221; is very different from actually showing some sexy screenshots.</p>
<p style="text-align: center;"><a href="http://ducksboard.com/wp-content/uploads/teaser_screenshot.jpg"><img class="aligncenter size-full wp-image-81" title="Teaser screenshot" src="http://ducksboard.com/wp-content/uploads/teaser_screenshot.jpg" alt="Teaser screenshot" width="400" height="300" /></a></p>
<p><strong>And, above all, have fun</strong></p>
<p>In the end it&#8217;s the main reason why we started the company. And we are being pretty good at doing it until now <img src='http://ducksboard.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/launching-teaser-page-haker-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Google data services with Wireshark and socat</title>
		<link>http://ducksboard.com/blog/debugging-google-data-services-wireshark-socat/</link>
		<comments>http://ducksboard.com/blog/debugging-google-data-services-wireshark-socat/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 15:58:44 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://ducks.wpengine.com/?p=22</guid>
		<description><![CDATA[Getting info from Google Analytics seemed like a pretty straightfoward job. Authenticate with OAuth, connect to the Data Feed, ask for JSON, parse, done. Luck had it that the library we&#8217;re heavily using here for  networking tasks was giving errors.  So I started scratching my head, playing with the Google OAuth Playground, trying different things, [...]]]></description>
			<content:encoded><![CDATA[<p>Getting info from Google Analytics seemed like a pretty straightfoward job. Authenticate with <a title="OAuth for Web Applications" href="http://code.google.com/apis/accounts/docs/OAuth.html">OAuth</a>, connect to the <a title="Google Data API" href="http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDataFeed.html">Data Feed</a>, ask for JSON, parse, done. Luck had it that the library we&#8217;re heavily using here for  networking tasks was giving errors.  So I started scratching my head, playing with the <a title="Googla OAuth Playground" href="http://googlecodesamples.com/oauth_playground/">Google OAuth Playground</a>, trying different things, and it all seemed to be working. But my library was definantly giving me errors.</p>
<p>At this moment you are probably asking: &#8220;but what error is it?&#8221;. The answer is: an error signalling that the connection to the server has been closed and the library is not sure if all data has been received. Basically it was saying that Google was disconnecting me in the middle of getting the data. Now I was curious.</p>
<p>My usual way of approaching such issues is firing up <a title="Wireshark Network Analyzer" href="http://wireshark.org/">Wireshark</a> and looking at the bytes being sent on the wire to see exactly what is happening. The only problem was that the Google Analytics Data Feed is using SSL, so I couldn&#8217;t actually see the HTTP requests going back and forward. Trying HTTP instead of HTTPS turned out to be a dead end: Google was answering with a 302 redirect to the HTTPS host. And here is  where socat enters the scene.</p>
<p><a href="http://www.dest-unreach.org/socat/">socat</a> is a multipurpose relay tool that&#8217;s roughly similar to netcat. It allows you to connect two endpoints and set up a bidirectional transfer between them. I won&#8217;t be going into details, the man page is very exhaustive, and a command line is worth a thousand words. Here is what I used:</p>
<pre>socat TCP-LISTEN:10001, reuseaddr=1, fork OPENSSL-CONNECT:www.google.com:443, verify=0, reuseaddr=1</pre>
<p>This makes socat open a local TCP socket on port 10001, forking a new process for each connection, and connect it to a SSL-over-TCP socket that gets connected to www.google.com on port 443. The reuseaddr parameters set SO_REUSEADDR on the socket, so you can retry immediately after you Ctrl+C socat (very useful). With that in place I fired up Wireshark, asked it to dump traffic from the loopback interface, changed the Google URL in my application to https://localhost:10001, and started it again. And it responded with a 302. But this time I saw the bytes in Wireshark and could see that it was because I was sending the wrong Host header (namely &#8220;localhost:10001&#8243;), breaking Google&#8217;s virtual hosting and triggering a redirect to the default site (www.google.com).</p>
<p>After kicking my app into submission to force it to send a &#8220;www.google.com&#8221; Host header, I got a 401 Unauthorized. Another round of head scratching ensuned, and after it I realized that with OAuth you sign the request URL, which for me looked like &#8220;http://localhost:10001/analytics/&#8230;&#8221;, but Google was expecting the signed URL to be &#8220;http://www.google.com/analytics/&#8230;&#8221;. After hacing the OAuth library to sign a different URL that the one I&#8217;ve been using to issue the request, I finally have been able to reproduce my original problem, but this time with the entire HTTP conversation captured in Wireshark.</p>
<p>And that was all I needed to confirm that the problem was in the Google server not setting neither Content-Length nor Transfer-Encoding headers on their responses. Without the Content-Length header, when the server disconnects you, there is no way to be sure whether you&#8217;ve received all of the content, or the connection has been broken in the middle. The library we&#8217;re using was reacting by raising a error warning about a potential loss of data and it had all rights to do this. On the other hand, what I saw in Wireshark seemed to be the entire content, so it seems that Google is simply neglecting to set Content-Length in their responses. For extra fun, the OAuth playground returns responses with Transfer-Encoding: chunked, which obviates the need to use Content-Length, but the real service apparently does not (or perhaps only does it for larger responses).</p>
<p>After that it was just a matter of ignoring that error when using Google Data Services and assuming that all content has been transferred even if the response was missing Content-Length. But it might have been a much longer and painful debugging session if it weren&#8217;t for socat and Wireshark.</p>
<p>And finally, a question to all of you. Can you guess which library we are using for networking? I believe I gave enough hints already, but I&#8217;ll drop a last one: it&#8217;s quirky, but it&#8217;s awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://ducksboard.com/blog/debugging-google-data-services-wireshark-socat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
