philadelphia - philly emerging tech...started get "/users" for 127.0.0.1 at 2012-04-09...

171

Upload: others

Post on 15-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 2: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 3: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Philadelphia Emerging Technology

for the enterprise!

Page 4: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Aaron Patterson

Page 5: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

@tenderlove

Page 7: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

AT&T, AT&T logo and all AT&T related marks are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies.

Page 8: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Señor Engineer

Page 9: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Señor Engineer^Enterprise

Page 10: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ruby-corerails-core

Page 11: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

WWFMD?

Page 12: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Philadelphia Emerging Technology

for the enterprise!

Page 13: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

STAR TREK

Page 14: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Engage!The Latest in Replicator Technology

Page 15: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Philadelphia Emerging Technology

for the enterprise!

Page 16: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Code CharcuterieCuring Rails

Page 17: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

AmateurCharcuterier (sp?)

Page 18: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 19: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 20: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 21: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 22: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Tight Coupling?

Page 23: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Managing Risk

Page 24: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Set Expectations

Page 25: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Enterprise

Risk Management

Rails

Page 26: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Enterprise

Page 27: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

What does it mean?

Page 28: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 29: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

[exec] **** info Wed Mar 07 10:20:01 EST 2012 1331076001656 /DPSLicense atg.service.ServiceResources->dynamoPrintMaxSessions : Only 20 concurrent sessions can be managed with this license[exec] **** info Wed Mar 07 10:20:01 EST 2012 1331076001656 /DPSLicense atg.service.ServiceResources->dynamoPrintMaxDynamoServers : Only 3 Dynamo server(s) can be used concurrently with this license[exec] **** info Wed Mar 07 10:20:01 EST 2012 1331076001656 /DPSLicense DPS is licensed to Hutchison 3G Australia Pty Limited - Development[exec] **** info Wed Mar 07 10:20:01 EST 2012 1331076001656 /DPSLicense atg.service.ServiceResources->unlimitedLicenseMsg : This product is licensed for an unlimited number of CPUs.[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003062 /atg/epub/version/VersionManagerRepository SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003203 /atg/dynamo/server/SQLRepositoryEventServer Service /atg/dynamo/server/SQLRepositoryEventServer listening at http://cgi-hxc15q12:3040/[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003265 /atg/epub/process/ProcessData-ver SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003281 /atg/epub/process/ProcessDataRepository SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003390 /atg/epub/file/PublishingFiles-ver SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003421 /atg/epub/file/PublishingFileRepository SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003781 /atg/userprofiling/InternalProfileRepository SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003890 /atg/dynamo/security/AdminSqlRepository SQL Repository startup complete[exec] **** info Wed Mar 07 10:20:03 EST 2012 1331076003890 /atg/dynamo/security/AdminAccountInitializer Initializing account database /atg/dynamo/security/AdminAccountManager from /atg/dynamo/security/SimpleXmlUserAuthority[exec] Nucleus running[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004453 / Unable to create class atg.deployment.server.DeploymentServer for configuration /atg/epub/DeploymentServer java.lang.NoClassDefFoundError: javax/ejb/FinderException[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / Unable to resolve component /atg/epub/Configuration java.lang.NoClassDefFoundError: javax/ejb/FinderException[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at java.lang.Class.forName0(Native Method)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at java.lang.Class.forName(Class.java:242)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.PropertyEditors.getPropertyEditor(PropertyEditors.java:254)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.getProperty(BeanConfigurator.java:731)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.configureStateProperty(BeanConfigurator.java:683)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.configureStateProperty(BeanConfigurator.java:594)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.configureState(BeanConfigurator.java:418)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.PropertyConfiguration.configureState(PropertyConfiguration.java:809)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.PropertyConfiguration.configureService(PropertyConfiguration.java:748)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SingleNucleusConfigurator.configureService(SingleNucleusConfigurator.java:62)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureService(NucleusNameResolver.java:1319)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:1119)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:787)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:569)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:550)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:394)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:1051)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.ConfigurationRef.getValue(ConfigurationRef.java:81)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.ConfigurationRefProperty.getValue(ConfigurationRefProperty.java:82)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleComponentState.setBeanProperty(SimpleComponentState.java:357)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleConfigurationState.saveToBean(SimpleConfigurationState.java:218)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleConfigurationState.configureBean(SimpleConfigurationState.java:241)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.configureBean(BeanConfigurator.java:275)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.PropertyConfiguration.configureService(PropertyConfiguration.java:752)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SingleNucleusConfigurator.configureService(SingleNucleusConfigurator.java:62)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureService(NucleusNameResolver.java:1319)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:1119)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:787)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:569)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:550)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:394)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:1051)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.ConfigurationRefArray.getValue(ConfigurationRefArray.java:146)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleComponentState.setBeanProperty(SimpleComponentState.java:357)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleConfigurationState.saveToBean(SimpleConfigurationState.java:218)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SimpleConfigurationState.configureBean(SimpleConfigurationState.java:241)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.BeanConfigurator.configureBean(BeanConfigurator.java:275)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.PropertyConfiguration.configureService(PropertyConfiguration.java:752)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.SingleNucleusConfigurator.configureService(SingleNucleusConfigurator.java:62)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureService(NucleusNameResolver.java:1319)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:1119)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:787)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:569)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:550)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:394)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.Nucleus.resolveName(Nucleus.java:2648)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.GenericService.resolveName(GenericService.java:315)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.nucleus.GenericService.resolveName(GenericService.java:367)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.adapter.gsa.xml.TemplateParser.runParser(TemplateParser.java:5498)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 / at atg.adapter.gsa.xml.TemplateParser.main(TemplateParser.java:5072)[exec] **** Error Wed Mar 07 10:20:04 EST 2012 1331076004484 /

stack trace

Page 30: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Numerous Developers

Legacy Systems

Conservative Estimates

Page 31: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Enterprise

Developer

Page 32: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Developer

Page 33: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

SPEEDSpeed of tests

Page 34: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Fast Development

Page 35: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Fast Feedback

Page 36: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Scale-able

Scale like a Barn Door

Page 37: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Stable

Page 38: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Testable

Page 39: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Integration

Page 40: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Understandable

Reason about our System

Page 41: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Effort

How long for feature XYZ?

Page 42: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk

Page 43: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

EnterpriseDeveloper

Page 44: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk Time to Market

Enterprise?

Page 45: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk Time to Market

Enterprise?

Page 46: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk Time to Market

Enterprise?

Page 47: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk vs. Time

Startup dev: no time to set up two DCs

Enterprise dev: we must have the availability

Page 48: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ImpostorSyndrome

Page 49: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Señor Engineer^Enterprise

Page 50: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Señor Engineer

Page 51: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Risk Management

Page 52: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 53: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Hardware

App Architecture

Rails

Code

Page 54: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Hardware

Page 55: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Load Balancers

CDNs

App Servers

DBsStartups probably won't use this technique

Page 56: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Load Balancers

CDNs

App Servers

DBs

Load Balancers

CDNs

App Servers

DBsStartups probably won't use this technique

Page 57: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

App Architecture

Page 58: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Service Oriented

Page 59: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Rails

Rails Sinatra

Oracle

Sinatra

Lucene

Page 60: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Rails

Rails Sinatra

Oracle

Sinatra

Lucene

Page 61: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Rails

Page 62: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Enterprise Extensions

Page 63: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

3 Steps to Enterprise

Page 64: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

3 Steps to Enterprise

• gem install sox

• gem install pci

• gem install COPA ;-)

Page 65: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Architecture

Page 66: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

"Lay of the land"

Page 67: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

M

V

C

Page 68: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatch

ActionViewActiveRecord

Page 69: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatchJourney

Rack

Controller

Controller

Page 70: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatchJourney

Rack

Controller

Controller

Page 71: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatchJourney

Rack

Controller

Controller

Page 72: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatchJourney

Rack

Controller

Controller

Page 73: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionDispatchJourney

Rack

Controller

Controller

Page 74: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class MyController def show @user = User.find 1 endend

Page 75: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 76: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 77: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 78: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 79: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 80: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActiveRecordARel

User.find(1)

DB Adapter

Model

Database

Page 81: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

<html><body> Hello! <%= @user.name %>,

How are you?</body></html>

Page 82: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewERB gets evaluated with IVAR contexts

Page 83: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewERB gets evaluated with IVAR contexts

Page 84: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewERB gets evaluated with IVAR contexts

Page 85: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewERB gets evaluated with IVAR contexts

Page 86: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewERB gets evaluated with IVAR contexts

Page 87: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ERBRuby

ActionView

Call Method

ViewCaching

Page 88: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionView

Call Method

ViewCaching

Page 89: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionView

Call Method

ViewCaching

Page 90: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionView

Call Method

ViewCaching

Page 91: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ActionView

Call Method

ViewCaching

Page 92: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Loggins

Page 93: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Loggins

Page 94: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Logging

Page 95: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Default

Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700Processing by UsersController#index as */* Rendered users/index.html.erb within layouts/application (3.8ms)Completed 500 Internal Server Error in 76ms

Page 96: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Use Ruby's Logger

config.logger = ::Logger.new($stdout)config.logger.formatter = ::Logger::Formatter.new

Page 97: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Ruby's Logger

I, [2012-04-09T07:50:39.655003 #64706] INFO -- : I, [2012-04-09T07:50:39.673190 #64706] INFO -- : Processing by D, [2012-04-09T07:50:39.698997 #64706] DEBUG -- : User Load (0.1...I, [2012-04-09T07:50:39.741429 #64706] INFO -- : Rendered users/I, [2012-04-09T07:50:39.747837 #64706] INFO -- : Completed 500 Internal Server...F, [2012-04-09T07:50:39.751075 #64706] FATAL -- :

Page 98: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Ruby's Logger

I, [2012-04-09T07:50:39.655003 #64706] INFO -- : I, [2012-04-09T07:50:39.673190 #64706] INFO -- : Processing by D, [2012-04-09T07:50:39.698997 #64706] DEBUG -- : User Load (0.1...I, [2012-04-09T07:50:39.741429 #64706] INFO -- : Rendered users/I, [2012-04-09T07:50:39.747837 #64706] INFO -- : Completed 500 Internal Server...F, [2012-04-09T07:50:39.751075 #64706] FATAL -- :

Log Level

Page 99: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Ruby's Logger

I, [2012-04-09T07:50:39.655003 #64706] INFO -- : I, [2012-04-09T07:50:39.673190 #64706] INFO -- : Processing by D, [2012-04-09T07:50:39.698997 #64706] DEBUG -- : User Load (0.1...I, [2012-04-09T07:50:39.741429 #64706] INFO -- : Rendered users/I, [2012-04-09T07:50:39.747837 #64706] INFO -- : Completed 500 Internal Server...F, [2012-04-09T07:50:39.751075 #64706] FATAL -- :

Timestamp

Page 100: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Ruby's Logger

I, [2012-04-09T07:50:39.655003 #64706] INFO -- : I, [2012-04-09T07:50:39.673190 #64706] INFO -- : Processing by D, [2012-04-09T07:50:39.698997 #64706] DEBUG -- : User Load (0.1...I, [2012-04-09T07:50:39.741429 #64706] INFO -- : Rendered users/I, [2012-04-09T07:50:39.747837 #64706] INFO -- : Completed 500 Internal Server...F, [2012-04-09T07:50:39.751075 #64706] FATAL -- :

PID

Page 101: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Filesystem Buffers

Page 102: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Log Sync Mode

if log.respond_to?(:write) and log.respond_to?(:close) @dev = logelse @dev = open_logfile(log) @dev.sync = trueend

Page 103: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

No Buffering

config.logger = Logger.new('prod.log')

Page 104: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Write Buffer

fh = File.open('logs.log', 'wb')config.logger = Logger.new(fh)

Page 105: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Throughput

fh = File.open 'buf.log', 'wb'buffered = Logger.new fhunbuffered = Logger.new 'unbuf.log'

txt = "X" * 1024

Benchmark.ips do |x| x.report("buffered") { buffered.info txt } x.report("unbuffered") { unbuffered.info txt }end

Page 106: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Throughput

0

6250

12500

18750

25000

K / s

no buffer buffered

Page 107: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

8K buffer

Page 108: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

SyslogLogger

Page 109: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

gem install syslog_logger

Page 110: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

config.logger = SyslogLogger.new

Page 111: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

LWEShttp://www.lwes.org/

Page 112: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Trade-OffsTrade performance for data integrity

Page 113: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Code

Page 114: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Prepared Statement Caching

Page 115: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

Page 116: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

select * from users where id = ?

Page 117: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

select * from users where id = ?

Page 118: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

id: 123456

Page 119: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

id: 123456

Page 120: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

Page 121: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

[id: 123456, 27]

Page 122: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

[id: 123456, 27]

Page 123: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Program

Database

[row, row, row]

Page 124: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

User.find(1)

Page 125: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Select

Table

"users"

Where

Equal

"id" 1

User.find(1)

Page 126: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Select

Table

"users"

Where

Equal

"id" ?

User.find(1)

[1]

Page 127: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Person.where(:id => 1).arel.to_dot

Page 128: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

AST Transformations Buy New Features

Page 129: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Configuration Disables Bind Values

Page 130: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Instrumentation

Page 131: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Publishing

ActiveSupport::Notifications.instrument("render") do render :text => "Foo"end

Page 132: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Subscribing

events = []

ActiveSupport::Notifications.subscribe("render") do |*e| events << eend

Page 133: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

def instrument(name, payload={}) started = Time.now

begin yield ensure @notifier.publish(name, started, Time.now, @id, payload) endend

Always Time.now even if no-one listening

Page 134: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

my time + children

Page 135: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Missing Information

Page 136: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

-> start rendering -> start execute SQL <- finish execute SQL -> start execute SQL <- finish execute SQL<- finish rendering

Page 137: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Rendering

SQLSQL

Page 138: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class Listener def start(event) end

def finish(event) endend

listener = Listener.new

AS::Notifications.subscribe("render", listener)

Page 139: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Evented Publishing

def instrument(name, payload={}) @notifier.start(name, @id, payload) begin yield ensure @notifier.finish(name, @id, payload) endend

Page 140: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Make it Quackclass Timed def initialize(pattern, delegate) @delegate = delegate @timestack = Hash.new { |h,id| h[id] = Hash.new { |ids,name| ids[name] = [] } } end

def start(name, id, payload) @timestack[id][name].push Time.now end

def finish(name, id, payload) started = @timestack[id][name].pop @delegate.call(name, started, Time.now, id, payload) endend

Page 141: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Tiny Factory

def subscribe(pattern = nil, listener = Proc.new) if listener.respond_to?(:call) subscriber = Timed.new pattern, listener else subscriber = listener end @subscribers << subscriberend

Page 142: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Mitigate Risk by Inspecting Objects

Page 143: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Our Reward

Page 144: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class Indented def initialize @indentation = 0 end

def start name, id, payload print indent puts "-> #{name} -- #{payload[:virtual_path]}" @indentation += 1 end

def finish name, id, payload @indentation -= 1 print indent puts "<- #{name} -- #{payload[:virtual_path]}" end

private def indent " " * @indentation endend

ActiveSupport::Notifications.notifier.subscribe(nil, Indented.new)

Page 145: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

-> process_action.action_controller -- -> render_template.action_view -- -> !render_template.action_view -- sessions/index <- !render_template.action_view -- sessions/index <- render_template.action_view -- -> !render_template.action_view -- layouts/application -> render_partial.action_view -- -> !render_template.action_view -- layouts/_navigation <- !render_template.action_view -- layouts/_navigation <- render_partial.action_view -- -> render_partial.action_view -- -> !render_template.action_view -- sessions/_slim_login <- !render_template.action_view -- sessions/_slim_login <- render_partial.action_view -- <- !render_template.action_view -- layouts/application<- process_action.action_controller --

Page 146: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within
Page 147: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ROOT (0.000 ms)

start_processing.action_controller (0.021 ms)controller MessagesController

action indexmethod GET

path /messages

process_action.action_controller (95.463 ms)controller MessagesController

action indexmethod GET

path /messages

sql.active_record (0.557 ms)

sql SELECT "people".* FROM"people" WHERE "people"."id"

name Person Load

sql.active_record (5.671 ms)

sql

SELECT "messages"."id" ASt0_r0, "messages"."address_id"

AS t0_r1, "messages"."from" ASt0_r2, "messages"."to" AS

t0_r3, "messages"."disposable"AS t0_r4, "messages"."subject"

AS t0_r5, "messages"."body" ASt0_r6, "messages"."plain" ASt0_r7, "messages"."html" AS

t0_r8, "messages"."created_at"AS t0_r9,

"messages"."updated_at" ASt0_r10,

"messages"."parsed_message_id"AS t0_r11, "addresses"."id" ASt1_r0, "addresses"."name" ASt1_r1, "addresses"."person_id"

AS t1_r2,"addresses"."created_at" AS

t1_r3,"addresses"."updated_at" AS

t1_r4 FROM "messages" LEFTOUTER JOIN "addresses""addresses_messages" ON

"addresses_messages"."id" ="messages"."address_id" INNER

JOIN "addresses" ON"messages"."address_id" ="addresses"."id" WHERE

"addresses"."person_id" = ?name SQL

render_template.action_view (63.632 ms)identifier /app/views/messages/index.html

layout layouts/application

!render_template.action_view (4.564 ms)virtual_path layouts/application

!render_template.action_view (63.574 ms)virtual_path messages/index

render_partial.action_view (0.346 ms)identifier /app/views/layouts/_navigation

render_partial.action_view (0.133 ms)identifier /app/views/sessions/_logout.ht

!render_template.action_view (0.291 ms)virtual_path layouts/_navigation

!render_template.action_view (0.087 ms)virtual_path sessions/_logout

render_partial.action_view (62.509 ms)identifier /app/views/messages/_message_l

!render_template.action_view (62.443 ms)virtual_path messages/_message_list

Page 148: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

ROOT (0.000 ms)

start_processing.action_controller (0.021 ms)controller MessagesController

action indexmethod GET

path /messages

process_action.action_controller (95.463 ms)controller MessagesController

action indexmethod GET

path /messages

sql.active_record (0.557 ms)

sql SELECT "people".* FROM"people" WHERE "people"."id"

name Person Load

sql.active_record (5.671 ms)

sql

SELECT "messages"."id" ASt0_r0, "messages"."address_id"

AS t0_r1, "messages"."from" ASt0_r2, "messages"."to" AS

t0_r3, "messages"."disposable"AS t0_r4, "messages"."subject"

AS t0_r5, "messages"."body" ASt0_r6, "messages"."plain" ASt0_r7, "messages"."html" AS

t0_r8, "messages"."created_at"AS t0_r9,

"messages"."updated_at" ASt0_r10,

"messages"."parsed_message_id"AS t0_r11, "addresses"."id" ASt1_r0, "addresses"."name" ASt1_r1, "addresses"."person_id"

AS t1_r2,"addresses"."created_at" AS

t1_r3,"addresses"."updated_at" AS

t1_r4 FROM "messages" LEFTOUTER JOIN "addresses""addresses_messages" ON

"addresses_messages"."id" ="messages"."address_id" INNER

JOIN "addresses" ON"messages"."address_id" ="addresses"."id" WHERE

"addresses"."person_id" = ?name SQL

render_template.action_view (63.632 ms)identifier /app/views/messages/index.html

layout layouts/application

!render_template.action_view (4.564 ms)virtual_path layouts/application

!render_template.action_view (63.574 ms)virtual_path messages/index

render_partial.action_view (0.346 ms)identifier /app/views/layouts/_navigation

render_partial.action_view (0.133 ms)identifier /app/views/sessions/_logout.ht

!render_template.action_view (0.291 ms)virtual_path layouts/_navigation

!render_template.action_view (0.087 ms)virtual_path sessions/_logout

render_partial.action_view (62.509 ms)identifier /app/views/messages/_message_l

!render_template.action_view (62.443 ms)virtual_path messages/_message_list

Page 149: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Ruby is an Awesome Tool

Page 150: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Rails is anAwesome Framework

Page 151: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

But YOU Must Manage Risk

Page 152: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Questions?

Page 153: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Avoiding Surprise Null Pointers

Page 154: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Hello <%= @naem %>

Page 155: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

$stdout.write "Hello "$stdout.write(( @naem ).to_s)

Page 156: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class Controller def show @name = "Aaron" end

def html $stdout.write "Hello " $stdout.write(( @naem ).to_s) $stdout.write("\n") endend

ctrl = Controller.newctrl.showctrl.html

Page 157: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

$ ruby test.rbHello $

Page 158: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

$ ruby -w test.rbtest.rb:8: warning: instance variable @naem not initializedHello $

ruby -w

Page 159: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Use Methods

Page 160: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Hello <%= naem %>

Page 161: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

$stdout.write "Hello "$stdout.write(( naem ).to_s)

Page 162: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

undefined local variable or method `naem'(NameError)

Page 163: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class SessionsController < ApplicationController def name @user.name end

helper_method :name

def show @user = User.find 1 end

def index @users = User.all endend

Page 164: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

NoMethodError: undefined method `name' for nil:NilClass

Page 165: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Context Objects

Page 166: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class UserController < ApplicationController attr_reader :ctx helper_method :ctx

class ShowContext def initialize(user) @user = user end

def name @user.name end end

def show @user = User.find 1 @ctx = ShowContext.new(@user) endend

Page 167: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Hello <%= ctx.naem %>

Page 168: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

undefined method `naem' for #<UserController::ShowContext:0x1>

Page 169: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

class UserController < ApplicationController attr_reader :ctx helper_method :ctx

class ShowContext def initialize(user) @user = user end

def name @user.name end end

class IndexContext end

def show @user = User.find 1 @ctx = ShowContext.new(@user) end

def index @ctx = IndexContext.new endend

Page 170: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Testability

Page 171: Philadelphia - Philly Emerging Tech...Started GET "/users" for 127.0.0.1 at 2012-04-09 07:38:54 -0700 Processing by UsersController#index as */* Rendered users/index.html.erb within

Known Failures