Object, measure thyself

35
Object, Measure Thyself Greg Opaczewski – Orbitz Worldwide Michael Ducy – BMC Software

description

The first conference presentation on Graphite circa 2008

Transcript of Object, measure thyself

Page 1: Object, measure thyself

Object, Measure Thyself

Greg Opaczewski – Orbitz Worldwide

Michael Ducy – BMC Software

Page 2: Object, measure thyself

Open Source

• ERMA Project :

http://launchpad.net/erma

• Graphite Project : http://launchpad.net/graphite

Page 3: Object, measure thyself

Complex Environment

Page 4: Object, measure thyself

$10.8 Billion in Gross Bookings in 2007

Page 5: Object, measure thyself

Myths of Instrumentation

• No Time For Instrumentation

• No Value ($) in Instrumentation

• Instrumentation Causes Bugs

Page 6: Object, measure thyself

Myth: No Time For Instrumentation

Page 7: Object, measure thyself

ERMAExtremely Reusable Monitoring API

Page 8: Object, measure thyself

TransactionMonitor monitor = new TransactionMonitor(“HotelService.purchase”);

try {response = hotelSupplier.reserve(hotel);monitor.succeeded();

} catch (ServiceException e) {monitor.failedDueTo(e);throw e;

} finally {monitor.done();

}

ERMA

Page 9: Object, measure thyself

Self-Instrumentation by:

• Hooks – Interceptors and Listeners

• Abstraction – Abstract the details away from developers

• AOP – Aspect Oriented Programming

Page 10: Object, measure thyself

Frameworks - Hooks

• Spring Framework

Page 11: Object, measure thyself

Frameworks - Abstraction

Page 12: Object, measure thyself

Self-Instrumentation by:

• Aspect Oriented Programming (AOP)

<aop:config>

<aop:aspect id="transactionMonitorActionAspect"

ref="transactionMonitorActionAdvice">

<aop:pointcut id="transactionMonitorActionPointcut“

expression="target(org.springframework.webflow.execution.Action)

and args(context)"/>

<aop:around pointcut-ref="transactionMonitorActionPointcut“

method="invoke"/>

</aop:aspect>

</aop:config>

Page 13: Object, measure thyself

Myth: No Time For Instrumentation

Page 14: Object, measure thyself

Myth: No Value ($) in Instrumentation

Page 15: Object, measure thyself

Event Aggregation

Page 16: Object, measure thyself

Event Aggregation

Page 17: Object, measure thyself

Storage and Visualization: Graphite

Page 18: Object, measure thyself

Graphite

Page 19: Object, measure thyself

Graphite

Page 20: Object, measure thyself

Graphite Demo

Page 21: Object, measure thyself

Value to the Business

• Fixing Production Problems Fast

• Capacity Planning

• Business Product teams rely on ERMA data

Page 22: Object, measure thyself

Myth: No Value ($) in Instrumentation

Page 23: Object, measure thyself

Myth: Instrumentation Causes Bugs

Page 24: Object, measure thyself

Avoid Boilerplate

@Monitored

public interface HotelService {

void purchase(Itinerary itinerary);

void cancel(Itinerary itinerary);

}

Page 25: Object, measure thyself

Avoid Boilerplate

public interface HotelService {

@Monitored(includeArguments = true)

void purchase(Itinerary itinerary);

void cancel(Itinerary itinerary);

}

Page 26: Object, measure thyself

Uncovers Bugs

• Allows you to base line across builds

• MASF and SPC

• Event Pattern Monitoring

Page 27: Object, measure thyself

Base Lining

• Compare present performance vs. historical performance

• Validate testing via theoretical models

Page 28: Object, measure thyself

MASF and SPC

Page 29: Object, measure thyself

Need for Abstractionabstraction

Webapp

Travel Business Services

Switching Services

Transaction Services

Suppliers

Page 30: Object, measure thyself

Event Pattern Monitoring

wl|httpIn.shop.search.air.redirect_searchFailure

wl|AirSearchExecuteAction.search

wl|com.orbitz.ojf.OJFClient.getInternal

wl|jiniOut_ShopService_createResultSet

tbs-shop|jiniIn_ShopService_createResultSet

tbs-shop|jiniOut_LowFareSearchService_execute

air-search|jiniIn_LowFareSearchService_execute

air-search|com.orbitz.afo.lib.SearchFilter

air-search|com.orbitz.afo.lib.LowFareSearchServiceImpl.execute

air-search|jiniOut_AirportLookupService_findLocationByIATACode

market|jiniIn_LocationService|DbPoolExhaustedException

Page 31: Object, measure thyself

Myth: Instrumentation Causes Bugs

Page 32: Object, measure thyself

Final Thought

Performance monitoring is easy when the objects practically measure themselves.

Page 33: Object, measure thyself

Thank You

• Special thanks to:– Fellow Co-Authors – Matthew O’Keefe and

Stephen Mullins– Neil Gunther – Mentoring and Candid Editorial

Review– Lead Graphite Developer – Chris Davis

Page 34: Object, measure thyself

Websites

• ERMA Project :

http://launchpad.net/erma

• Graphite Project : http://launchpad.net/graphite