aro for developers

40
AT&T Application Resource Optimizer (ARO) A Guide for Developers Doug Sillars Bill Weir April 2015

Upload: doug-sillars

Post on 28-Jul-2015

86 views

Category:

Mobile


1 download

TRANSCRIPT

Page 1: ARO For Developers

AT&T Application Resource Optimizer (ARO)

A Guide for Developers

Doug Sillars

Bill Weir

April 2015

Page 2: ARO For Developers

Mobile Development Is ChallengingThere are a lot of issues to consider… 19,000 Android User Agents reported by Akamai

There are Screen Size differences

Processor/Memory constraints

Battery constraints

And there are constraints inherent in Wireless Networks

It isn’t easy!

Page 3: ARO For Developers

Don’t Let Users Do Your Quality Control44% of all issues are reported by users20% issues were only found because of complaints in app reviews

34% of Users use ratings as primary influence in choosing an app

http://info.perfectomobile.com/rs/perfectomobile/images/why-apps-fail-infographic.pdf

Page 4: ARO For Developers

Users Expect Things to Just Work

This was an actual tweet.

Page 5: ARO For Developers

Defects vs. PerformanceIs Performance REALLY that important? Yes!

https://t.co/7bMT4A1PIt

Page 6: ARO For Developers

Top App Complaints from Consumers

1.User Interface Issues (58%)

2.Performance (52%)

3.Functionality (50%)

4.Device Compatibility (45%)

Page 7: ARO For Developers

Performance Importance?How Important is Speed and Responsiveness of Mobile Apps?

https://t.co/7bMT4A1PIt

From a Mobile User Survey conducted by Dimensional Research

Page 8: ARO For Developers

How Fast Should an App Startup?

72%<3 seconds

49%<2 seconds

91%<4 seconds

https://t.co/7bMT4A1PIt

From a Mobile User Survey conducted by Dimensional Research

Page 9: ARO For Developers

Reactions to Poor Performance

Page 10: ARO For Developers

Check Your App’s Performance

http://smarterappsguidelines.gsma.com/

http://knowmyapp.org/

http://www.appqualityalliance.org/aqua-performance-test-criteria

http://developer.att.com/application-resource-optimizer

http://tspace.web.att.com/files/app#/file/9ecf48ae-b5f7-4780-8672-8c53520c1fb3

Here Are Some Guidelines:

Page 11: ARO For Developers

You Can Test Performance With ARO ARO Background

ARO Manual Test (Demo!)

ARO Analysis

ARO Automation (NEW!)

Page 12: ARO For Developers

Find The Issues Early With AROARO Records and Analyzes Network Interactions of App

Network use accounts for 40-70% of battery drain!

Page 13: ARO For Developers

ARO Requirements• Open Source and Free

Developer.att.com/ARO

• Required for AT&T Preload apps

• iOS

- Requires iOS device tethered to Mac (with Xcode)

• Android

- Requires Android device tethered to Mac/PC (with Android SDK)

Page 14: ARO For Developers

Testing Your App With ARO1. Move at a speed that emulates real users 2. Create flexible (yet reproducible) test cases

a. Test cases can even reflect more of a feature checklistb. The Trace is not about the order of the features, but about the

content 3. Likely Problem Areas

a. Startupb. Streaming

4. Be Curiousa. If something seems odd, explore it b. Screen rotation best practice came out of tester noticing the

network lighting up each time they turned the device 5. Background Data:

a. Run long test with app running in background

Page 15: ARO For Developers

Live Demo of ARO Test

Page 16: ARO For Developers

Demo Backup Slides

In ARO Analyzer App: Start Data collector

Name the testCapture Video or not

Page 17: ARO For Developers

Demo Backup SlidesARO establishes a VPN connection on your Android Device (click ok)

ARO shows Screen on your computer (if video is being recorded)

Click Stop to end ARO traceFiles copied to PC and analyzed

Page 18: ARO For Developers

ARO Analysis

All network traffic mapped to processes

Stats about trace

Page 19: ARO For Developers

Best Practices

Page 20: ARO For Developers

ARO Simple Analysis

5 Best Practices Graded for Preloads:1. Text File Compression

2. Duplicate Content

3. Closing Connections

4. Periodic Connections

5. GPS/Bluetooth

Page 21: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

AT&T Defect MetricsDuplicate Content

<5% of KB

5-20% of KB

20+% of KB

Periodic Connections

0-20% of Power

20-50% of Power

50+% of Power

GPS/BT

0-25% Active (s)

25-65% Active (s)

65+% Active (s)

Text Compression

100-500KB

500-1000KB

1000+KB

Closing Connections

0-20% of Power

20-50% of Power

50+% of Power

Sev 3

Sev 2

Sev 1

Page 22: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

Duplicate Content

AT&T preload says <5% is a pass.

This 2.8 KB file should be cached for 1 year. yet downloaded twice in ~2 minutes.

Page 23: ARO For Developers

Download Less Stuff: Caching17% of HTTP content on mobile is duplicate data

– Reading from Cache is 75-99% faster than downloading again

“Web Caching on Smartphones: Ideal vs. Reality”, http://www.research.att.com/~sen/pub/Caching_mobisys12.pdf

6.7MB 6.7MB

4.8 MB duplicate!75% possible savings!

(data AND speed)

Page 24: ARO For Developers

Caching Methods (How do I do it?)ETags

Cache Control Headers

•Each file has a Unique Tag

•Revalidated on server for each request– High Performance Web Sites:

Rule 1 – Make Fewer HTTP Requests (1)

– Adding a connection drains battery, adds 500-3,000 ms latency

• Important to carefully assign Max-Age times

•App will not check file on server until Max-Age is reached– Retrieval is strictly file processing time

(1) http://developer.yahoo.com/blogs/ydn/posts/2007/04/rule_1_make_few/

Page 25: ARO For Developers

Comparing ETag vs. Cache Control

Network Usage Battery Drain Data Usage Speed

NO Cache YES entire file downloaded

Full network connection made

High Slowest

ETagYes – ETag in cache

is validated on server

Full network connection Low Slow

Cache Control No N/A N/A Fast

Any Caching is better than no caching, but for mobile, Cache Control is preferred

Page 26: ARO For Developers

Closing Connections

< 20% Sev 3 defect

Blue Burst Color indicates Packets closing connections

Page 27: ARO For Developers

Closing Connections: CODE

MultiRes Sample app from Android SDK

– Modified to download images

HttpURLConnection getimagecloseconn = (HttpURLConnection) urln.openConnection();

getimagecloseconn.setRequestProperty("connection", "close");

getimagecloseconn.connect();String cachecontrol = getimagecloseconn.getHeaderField("Cache-Control");InputStream isclose = getimagecloseconn.getInputStream(); bitmap = BitmapFactory.decodeStream(isclose); getimagecloseconn.disconnect();

https://github.com/attdevsupport/ARO/tree/master/2013DevSummitTurbocharge

Page 28: ARO For Developers

GPS/Bluetooth

< 25% Sev 3 defect

Green Color Indicates active GPS usage

Page 29: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

GPS: AT&T DriveMode for Android

3 min

480 GPS connections/24hr

~20% Battery

Page 30: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

GPS: AT&T DriveMode for Android

Use activity APIs to identify when your users are in motion

11 minute trace

DetectedActivity.IN_VEHICLEDetectedActivity.ON_BICYCLE:DetectedActivity.ON_FOOT:

http://commons.wikimedia.org/wiki/File:Baby_goats_jan_2007_crop.jpghttp://commons.wikimedia.org/wiki/File:Goat_in_a_car.jpghttp://commons.wikimedia.org/wiki/File:2009_goat_and_bicycle_in_India_6512003001.jpg

Page 31: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

Periodic Connections:

• We have a great new service• But we need to poll every 30 seconds• Is this bad for the network?

AT&T Sample App

Page 32: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

AT&T Sample App (cont.)

• 2 concurrent connections• Extra Network utilization• If your capacity is set on # of connections – it just got halved

Page 33: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

AT&T Sample App (cont.)

• Moved to persistent connection – is this better?• 10 minutes = 20 connections 0.67% of battery• 1 hour =120 connections 4% of battery• 24 hours = 2880 connections 96.7% of battery

Page 34: ARO For Developers

Text Compression

> 1MB% Sev 1 defect

Page 35: ARO For Developers

Periodic Connections in the Background!Background traffic

Many Apps wake up in the background to update data or communicate with servers.

Just 10 background connections = 0.5% battery/day

And it adds up FAST!

Look at Android’s JobScheduler API (5.0 and up)

Page 36: ARO For Developers

Background Traffic

AT&T Corp Email

Facebook

Exercise app

Page 37: ARO For Developers

ARO Automation – Headless collectionBeta product: release planned July 2015

Command Line and Java APIs to run ARO

./aro --startcollector vpn_android --output /users/demo/MCoC_testing --video yes

Page 38: ARO For Developers

ARO Automation – Analysis• Open trace in Analyzer tool

• Analyze headlessly into JSON or HTML

./aro --analyze /users/demo/MCoC_testing --output /users/demo/MCoC_testing/report.html --format html

Page 39: ARO For Developers

ARO for Developers• Performance testing is crucial

• Good tools and test plans are essential

• AT&T Application Resource Optimizer (ARO)

• Testing manually

• Testing with automation

• Analysis and filing bugs

Page 40: ARO For Developers

© 2015 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies. All other marks contained herein are the property of their respective owners. Information contained herein is not an offer, commitment, representation or warranty by AT&T and is subject to change. Mention of a specific company or entity is not an endorsement by AT&T.

Q&A

http://smarterappsguidelines.gsma.com/

http://knowmyapp.org/

http://www.appqualityalliance.org/aqua-performance-test-criteria

http://developer.att.com/application-resource-optimizer

http://bit.ly/HighPerfAndroidApps