Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: March 2011

Librato Silverline: Application Monitoring and Workload Management Service

Monday, March 28, 2011 | Run time: 39:53

Joe Ruscio, CTO of Librato, demonstrates Silverline, an app-centric monitoring and workload management service. He shows how Silverline improves capacity planning, continuous deployment, RCA, alerting, and provides predictable degradation under load.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 03/28/2011: It's over -10,000!

Pivotal Labs
Monday, March 28, 2011

Turns out there’s a hidden “feature” in jQuery’s .animate method. If your starting point for an animation is less than -10,000 px, it sets it to 0. Meaning your -10000 to -12000 animation is going to move a surprising 12000 pixels. There, fixed that for ya!

The -10,000px limit is hard-coded deep in the jQuery animate code, we speculate that it may resolve an issue in one browser or another. So before you start creating Ken Burns-style photo pans with your gigapixel images, make sure you have a plan to dodge this limit.

We’re committed to providing clients with license information for all the libraries we use on each project. To that end, some Pivots have created LicenseFinder, a command line tool which scans your project for Rubygems and summarizes the license data it can recognize. It’s recently had some upgrades. [Check it out].(https://github.com/pivotal/LicenseFinder)

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 3.25.2011:

Pivotal Labs
Friday, March 25, 2011

Help

  • fonts.com is giving 404s, it appears their CDN is down
  • How do you style a File Input? There are several jQuery plugins that do this, one that worked well (and includes drag & drop support) is jQuery-File-Upload
  • Selenium + Webrat, oh my: If you try adding selenium tests to an existing test suite you may find that your test database data gets blown away. A good solution to this is to separate your selenium tests into another test suite and run them separately

Interesting

  • assert_template is just doing a regex, which means that it may incorrectly be passing if you are asserting on a string that is a substring of the actual template name you expect
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Bash Brace Expansion

Pivotal Labs
Thursday, March 24, 2011

In our static assets directory, we have the following directories:

   public/images
   public/javascripts
   public/stylesheets

We want to namespace our application (my_app). We could type the following:

   mkdir public/images/my_app
   mkdir public/javascripts/my_app
   mkdir public/stylesheets/my_app

Or to save time, we could type:

   mkdir public/{images,javascripts,stylesheets}/my_app

This will create the three directories with one command.

For more information on bash curly brace expansion, checkout this article by Mitch Frazier on Linux Journal.

Another expansion I’ve used:

   cp file.txt{,.bak}
      cp file.txt file.txt.bak
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Standup 3/24/2011: Spork and debugging

Jesse Toth
Thursday, March 24, 2011

Helps

“Chrome 11 + Webdriver + Java applets – Chrome 11 has changed the always allow Java plugins setting so that it is no longer global, and must be allowed for each applet. When running tests, Webdriver deletes the profile that stores this setting after each test run, causing specs to fail since a new dialog asking whether to allow the plugin pops up every time. Any ideas?”

The current fix seems to be to downgrade to Chrome 10.

“Does anyone know why using Spork + the ruby debugger just outputs ‘disconnected’ and doesn’t break at any breakpoints?”

The general consensus is to run tests on Spork and print out Spork when you want to debug.

Interesting Things

  • You should try Spork if you’re using Rails 3 and your tests are running slowly.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Barinek

Noop Handler – Catching 80K requests per second without breaking a sweat

Mike Barinek
Thursday, March 24, 2011

Sure it’s a noop test and running on a iMac i7, but 80K requests per second is pretty impressive for 40 lines of code.


package manual;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.util.thread.QueuedThreadPool;

public class NoopHandler {
    public static void main(String[] args) throws Exception {
        QueuedThreadPool pool = new QueuedThreadPool();
        pool.setMaxThreads(50);

        Server server = new Server();
        server.setThreadPool(pool);
        server.setGracefulShutdown(1000);
        server.setHandler(new AbstractHandler() {
            @Override
            public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
                response.setStatus(200);
                response.getWriter().write("noop");
                baseRequest.setHandled(true);
            }
        });
        server.start();

        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setPort(8080);
        server.addConnector(connector);
        connector.start();
    }
}

Here’s the apache benchmark information.


juniper:~ pivotal$ ab -n10000 -c20 -k http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        Jetty(7.2.2.v20101205)
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        4 bytes

Concurrency Level:      20
Time taken for tests:   0.127 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    10000
Total transferred:      980392 bytes
HTML transferred:       40016 bytes
Requests per second:    78840.73 [#/sec] (mean)
Time per request:       0.254 [ms] (mean)
Time per request:       0.013 [ms] (mean, across all concurrent requests)
Transfer rate:          7548.32 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     0    0   0.1      0       3
Waiting:        0    0   0.1      0       3
Total:          0    0   0.1      0       3

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      0
  95%      0
  98%      0
  99%      1
 100%      3 (longest request)

I’ve also been playing around with Mizuno and jruby-rack quite a bit recently. We’re hoping to find a high-performing solution for jruby.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 3.23.2011: update your rvm, bundler 1.0.10 fix, autofocus in WebKit

Pivotal Labs
Wednesday, March 23, 2011

Interesting things

  • Until yesterday rvm had bugs with double slashes in paths when doing an automatic install of a specific ruby when you cd to a directory. Grab the latest off github if you need this fix.

  • Updating Bundler 1.0.10 may result in parse errors if your yaml contains symbols. See this post for details: https://rails.lighthouseapp.com/projects/8994/tickets/6354-psych-does-not-handle-symbols- and try this in your config/boot.rb:

require 'yaml'
YAML::ENGINE.yamler= 'syck'
  • autofocus attribute + hover css rule in WebKit may not play nicely with each other
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Standup 3/22/2011: jQuery conference 2011

Jesse Toth
Tuesday, March 22, 2011

Interesting Things

  • jQuery conference 2011 San Francisco will be April 16-17. More info here
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Gehard

Using Firebug with WebDriver in Capybara/Cucumber – New and Improved

Mike Gehard
Monday, March 21, 2011

Forget the steps I published earlier…just install the capybara-firebug gem and away you go.

Thanks jfirebaugh!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 3.21.2011: Deactivating users in devise

Pivotal Labs
Monday, March 21, 2011

Interesting Things

All strategies that inherit from Devise::Strategies::Authenticatable (which may be all right now) check for user.active?. To deactivate a user, just add an active column to User model, and a message to present with inactive_message:

# User model

def active?
  !!active
end

def inactive_message
  "Sorry, this account has been deactivated."
end

and to test:

# Any session controller spec

it "should throw an error with an inactive user" do
  user = Factory.create(:user, :password => "password")
  user.active = false
  user.save!

  error = catch(:warden) do
    post :create, :user => {:username => user.username, :password => "password"}
  end

  error[:message].should =~ /deactivated/
end
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (780)
  • rails (113)
  • testing (88)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (55)
  • techtalk (44)
  • rspec (38)
  • ironblogger (32)
  • productivity (30)
  • activerecord (29)
  • gogaruco (29)
  • git (28)
  • nyc (27)
  • rubymine (26)
  • bloggerdome (23)
  • mobile (22)
  • process (21)
  • pivotal tracker (20)
  • cucumber (20)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • css (13)
  • tdd (13)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >