35
客户端网站性能 及用户行为数据采集 携程旅行网 储诚栋

客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

客户端网站性能及用户行为数据采集

携程旅行网 储诚栋

Page 2: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

储诚栋 高级研发经理携程旅行网 , 框架研发部

– 前端框架– 客户端性能优化– 用户行为数据采集

[email protected]

Page 3: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Overview of Data Collection

• Best Practices in Ctrip– Tracking Architecture and Deploy– Data Visualization– Alerting– Trouble Shooting

• More Usage

• Q&A

Agenda

Page 4: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Overview of Data Collection

Page 5: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Server-sidezabbix

Page 6: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Pseudo ClientGomez

Page 7: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Pseudo ClientCtrip Page Performance Test

Page 8: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Data collectionReal ClientGoogle Analytics

Page 9: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Tracking Architecture and DeployBest Practices in Ctrip

Page 10: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Basic PVs• User Actions• Page Performance• Error Tracking• User Blocks• Page View Flow

UBT ( User Behavior Tracking )

Page 11: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Data Stream

Page 12: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Javascript - high recommendation

• Image - no javascript supports

Client-side Tracking - Methods

Page 13: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Transfer page  - weibo, edm

Client-side Tracking - Methods

Page 14: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Data Loss– 15% -> 5% -> 2%– onload send data -> more triggers -> send 

queue

• Identify– dom: marks + xpath– position: center, left or auto adjust

Client-side Tracking - Difficulties

Page 15: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Server-side Tracking

Page 16: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Data Landing - ngix log

• Queue & Classify - activemq -> ctail

• Data Analysis

• Real-time - storm & push service

• Non-real-time - hadoop & map reduce

Server-side Tracking

Page 17: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Data VisualizationBest Practices in Ctrip

Page 18: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• PV

• UV

• CR

• Etc.

Base PV

Page 19: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• DNS• Connection• Request• Response• Blank• Interactive• Domready• Key resources loaded• Onload

Performance

Page 20: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Types– Click– Key press– Touch– Tab change

User Actions

Page 21: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• hook into js framework– normal execute– timeout, interval– event– html5 worker

• catch errors– try ... Catch

• window.onerror

Error Tracking

Page 22: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Form tips

• Business constraints

• Security problems

• Third-party issues

• Server maintenance

• Etc.

User Blocks

Page 23: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Page View Flow

Page 24: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

AlertingBest Practices in Ctrip

Page 25: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Examples– Page speed– Js errors per page– User blocks

per page

• Solutions– Base line– Moving average– Control chart / CPK (Process capability index)

Unseasonal

Page 26: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Examples– PV– UV– CR

• Solutions– Month-on-month– Year-on-year– Auto-Regressive and Moving Average Model

Seasonal Fluctuations

Page 27: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Examples– Rank: A / B / C / D / E– Score: 0 – 100

• Solutions– Weighted arithmetic mean

Site Health and Page Rank

Page 28: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Trouble ShootingBest Practices in Ctrip

Page 29: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Performance(Case 1)

Page 30: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Performance(Case 2)

Page 31: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Performance(Case 3)

Page 32: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Performance(Case 4)

Page 33: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

More Usage 

Page 34: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

• Client data associate with server data

• Real-time product recommendation

• Intelligent resource preload

• Data combine

• Etc.

More Usage

Page 35: 客户端网站性能 及用户行为数据采集 - O'Reillyvelocity.oreilly.com.cn/2013/ppts/performance_and_user... · 2017. 12. 18. · 储诚栋 高级研发经理 携程旅行网

Q&A储诚栋 高级研发经理携程旅行网 , 框架研发部

- 前端框架

- 客户端性能优化

- 用户行为数据采集

[email protected]