SlideShare une entreprise Scribd logo
1  sur  22
annalist,
an Erlang stats aggregator
  Florian Odronitz @ Berlin Erlounge July 2012
Motivation
• Application Statistics in Erlang
• Count things (e.g. new users/day)
• Record stats (e.g. 95 percentile of response
  time)
• Pretty graphs
• CSV for the Excel-folks
Concept

• Store stuff in two granularities
• Time and hierarchical tags
• so count([<<“read”>>, <<“book”>>])
 increments the counter in 14 keys
read/total

read/year/2012

read/month/2012/07

read/day/2012/07/24

read/hour/2012/07/24/23

read/minute/2012/07/24/23/01

read/second/2012/07/24/23/01/22

read/total

read/book/year/2012

read/book/month/2012/07

read/book/day/2012/07/24

read/book/hour/2012/07/24/23

read/book/minute/2012/07/24/23/01

read/book/second/2012/07/24/23/01/22
Components
• LevelDB stores data
• eleveldb interfaces with LevelDB
• uplevel provides bucket/key semantics and
  range queries
• Cowboy for JSON API
• sparks.js and Highstocks for graphs
LevelDB

• Local, persistent key-value store
• Ordered by key, iterations
• Atomic writes and snapshots
• Variable Cache Size
Features: Counting


annalist:count([<<"create">>, <<"opinion">>])
Features: Counting
Features: Counting
Features: Recording


annalist:record([<<"time">>, <<"get_user">>], 62.3)
Features: Recording
Features: Recording
• Store distributions of values in a space efficient
  manner with accuracy guaranties.
• Targeted Quantiles:
f_targeted([{0.05, 0.005}, {0.5, 0.02}, {0.95, 0.005}])

Allow a maximum error of 0,5% for 5th and 95th
percentile and 2% error for median. Errors are
errors in rank.
Features: Recording
Features: Recording
         1x107




         1x106




        100000




         10000
Value




          1000




           100




            10




             1


                 0    2000   4000   6000             8000   10000   12000   14000
                                           Inserts
Features: Recording
         1x107




         1x106




        100000




         10000
Value




          1000




           100




            10




             1


                 0    2000   4000   6000             8000   10000   12000   14000
                                           Inserts
Features: Recording
                                           80
Compressed size (comp. every 10 inserts)




                                           60




                                           40




                                           20




                                            0
                                                0    2000   4000   6000             8000   10000   12000   14000
                                                                          Inserts
Features: API
                              /annalist/hour_counts/
                              update%20user_location/
                                 2011/7/30/21/8640
                                ?callback=jQuery123

jQuery123([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0...0,0,0,19,81,73,96,139,205,120,79,25,0,0,0,0,0,0
,0,0,0,0,52,86,76,0,25,89,93,97,80,56,38,0,13,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,80,80,117,80,80,80
,80,80,79,80,80,12,0,0,0,0,0,0,0,0,0,0,0,0,72,80,80,79,79,80,80,80,80,80,80,80,80,80,196,208,240,249,236,160,160
,138,196,160,159,162,93,80,78,81,79,80,80,80,81,49,81,81,62,3,41,84,82,100,134,80,79,14,80,80,80,80,80,80,80,80,
79,80,80,67,60,68,158,79,77,211,242,231,209,80,105,161,206,240,240,238,240,237,239,239,239,239,241,148,80,80,80,
80,80,80,80,80,134,108,80,90,205,222,85,79,80,80,79,81,77,80,81,79,82,84,79,175,293,239,116,80,78,79,186,232,126
,142,22,163,177,175,176,164,168,167,166,180,177,173,168,34,0,0,109,179,180,176,178,162,180,174,173,163,175,166,1
73,173,178,179,164,130,0,0,0,0,21,11,0,0,0,17,44,141,145,162,73,0,0,0,0,5,118,0,6,0,197,232,0,69,80,80,80,78,28,
24,0,49,80,72,75,70,2,0,0,0,0,0,0,0,24,166,373,290,309,260,275,232,123,138,132,80,79,95,79,125,132,80,79,80,79,8
1,80,79,113,99,101,92,139,204,244,250,224,194,166,80,223,188,80,80,78,73,80,79,35,0,0,9,148,169,301,300,304,263,
109,251,272,171,138,114,183,184,12,0,0,0,0,0,0,0,0,0,189,299,145,114,184,174,196,225,241,264,231,52,85,163,166,5
0,3,11,15,9,29,55,19,84,149,132,115,90,68,56,97,112,235,315,301,289,274,223,242,273,260,260,293,308,294,189,180,
187,242,198,178,225,248,248,244,433,359,227,180,223,206,180,179,180,180,180,179,181,179,184,241,131,227,322,310,
  286,260,271,327,348,319,187,161,108,79,80,0,0,0,0,0,0,0,44,166,149,148,13,0,41,81,25,0,166,49,4,113,107,0]);
Characteristic
Characteristic

• Sparse counting
• No backpressure
• 1 gen_server, 1 CPU
• eventually consistent
Performance

• Counting:
  ~ 4k ops/sec with ([<<“a”>>, <<“b”>>])
  equals ~ 56k increments/sec
• Stats:
  ~ 690 ops/sec with ([<<“a”>>, <<“b”>>], 1)
  equals ~ 9.66k recordings/sec
Future

• HTTP API for stats
• CSV Export
• Purging
• Variable Timeslots
• Multiple Workers (CAS with locks in ets?)
Thanks
• leveldb.googlecode.com
• https://github.com/basho/eleveldb
• https://github.com/odo/uplevel
• https://github.com/odo/annalist
• https://github.com/extend/cowboy/
• http://omnipotent.net/jquery.sparkline/
• highcharts.com

Contenu connexe

En vedette

Ruby goes to hollywood
Ruby goes to hollywoodRuby goes to hollywood
Ruby goes to hollywoodehuard
 
Maple leaf foods
Maple leaf foodsMaple leaf foods
Maple leaf foodsjonholt523
 
Boost your-oop-with-fp
Boost your-oop-with-fpBoost your-oop-with-fp
Boost your-oop-with-fpUberto Barbini
 
Types of food and beverage services
Types of food and beverage servicesTypes of food and beverage services
Types of food and beverage servicesAmaresh Kumar
 

En vedette (6)

Google Docs
Google DocsGoogle Docs
Google Docs
 
Ruby goes to hollywood
Ruby goes to hollywoodRuby goes to hollywood
Ruby goes to hollywood
 
Maple leaf foods
Maple leaf foodsMaple leaf foods
Maple leaf foods
 
Boost your-oop-with-fp
Boost your-oop-with-fpBoost your-oop-with-fp
Boost your-oop-with-fp
 
Examples 2.0
Examples 2.0Examples 2.0
Examples 2.0
 
Types of food and beverage services
Types of food and beverage servicesTypes of food and beverage services
Types of food and beverage services
 

Similaire à annalist - a statistics aggregator written in erlang

Lj kitty scheme...
Lj kitty scheme...Lj kitty scheme...
Lj kitty scheme...yaddu420
 
An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...Arinto Murdopo
 
MongoDB and Apache HBase: Benchmarking
MongoDB and Apache HBase: BenchmarkingMongoDB and Apache HBase: Benchmarking
MongoDB and Apache HBase: BenchmarkingOlga Lavrentieva
 
Lean principles and practices
Lean principles and practicesLean principles and practices
Lean principles and practicesJelle Bens
 
Bass Diffusion Model
Bass Diffusion ModelBass Diffusion Model
Bass Diffusion ModelJoe Estephan
 
SPICE MODEL of FE126E in SPICE PARK
SPICE MODEL of FE126E in SPICE PARKSPICE MODEL of FE126E in SPICE PARK
SPICE MODEL of FE126E in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARKSPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARKTsuyoshi Horigome
 
A Function by Any Other Name is a Function
A Function by Any Other Name is a FunctionA Function by Any Other Name is a Function
A Function by Any Other Name is a FunctionJason Strate
 
Vertical format for trading account, profit and loss account & balance sheet
Vertical format for trading account, profit and loss account & balance sheetVertical format for trading account, profit and loss account & balance sheet
Vertical format for trading account, profit and loss account & balance sheetSAITO College Sdn Bhd
 
Analisis time series
Analisis time seriesAnalisis time series
Analisis time seriesXYZ Williams
 
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARKSPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARKTsuyoshi Horigome
 
ツィータースピーカーのスパイスモデル
ツィータースピーカーのスパイスモデルツィータースピーカーのスパイスモデル
ツィータースピーカーのスパイスモデルTsuyoshi Horigome
 
SPICE MODEL of FT48D in SPICE PARK
SPICE MODEL of FT48D in SPICE PARKSPICE MODEL of FT48D in SPICE PARK
SPICE MODEL of FT48D in SPICE PARKTsuyoshi Horigome
 
Wikipedia ws
Wikipedia wsWikipedia ws
Wikipedia wsYu Suzuki
 
Ditt actionplan
Ditt actionplanDitt actionplan
Ditt actionplandittjapan
 
Textile printing project dr.azhar 2004
Textile printing project dr.azhar 2004Textile printing project dr.azhar 2004
Textile printing project dr.azhar 2004softbiz1
 
Ppt compressed sensing a tutorial
Ppt compressed sensing a tutorialPpt compressed sensing a tutorial
Ppt compressed sensing a tutorialTerence Gao
 

Similaire à annalist - a statistics aggregator written in erlang (20)

Lj kitty scheme...
Lj kitty scheme...Lj kitty scheme...
Lj kitty scheme...
 
An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...
 
MongoDB and Apache HBase: Benchmarking
MongoDB and Apache HBase: BenchmarkingMongoDB and Apache HBase: Benchmarking
MongoDB and Apache HBase: Benchmarking
 
Extending Io Scalability
Extending Io ScalabilityExtending Io Scalability
Extending Io Scalability
 
Lean principles and practices
Lean principles and practicesLean principles and practices
Lean principles and practices
 
Bass Diffusion Model
Bass Diffusion ModelBass Diffusion Model
Bass Diffusion Model
 
SPICE MODEL of FE126E in SPICE PARK
SPICE MODEL of FE126E in SPICE PARKSPICE MODEL of FE126E in SPICE PARK
SPICE MODEL of FE126E in SPICE PARK
 
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARKSPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=8.2(Ohm) in SPICE PARK
 
A Function by Any Other Name is a Function
A Function by Any Other Name is a FunctionA Function by Any Other Name is a Function
A Function by Any Other Name is a Function
 
Vertical format for trading account, profit and loss account & balance sheet
Vertical format for trading account, profit and loss account & balance sheetVertical format for trading account, profit and loss account & balance sheet
Vertical format for trading account, profit and loss account & balance sheet
 
Analisis time series
Analisis time seriesAnalisis time series
Analisis time series
 
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARKSPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARK
SPICE MODEL of ZR6_RL=4.7(Ohm) in SPICE PARK
 
Design Project
Design ProjectDesign Project
Design Project
 
Navneet accounts
Navneet accountsNavneet accounts
Navneet accounts
 
ツィータースピーカーのスパイスモデル
ツィータースピーカーのスパイスモデルツィータースピーカーのスパイスモデル
ツィータースピーカーのスパイスモデル
 
SPICE MODEL of FT48D in SPICE PARK
SPICE MODEL of FT48D in SPICE PARKSPICE MODEL of FT48D in SPICE PARK
SPICE MODEL of FT48D in SPICE PARK
 
Wikipedia ws
Wikipedia wsWikipedia ws
Wikipedia ws
 
Ditt actionplan
Ditt actionplanDitt actionplan
Ditt actionplan
 
Textile printing project dr.azhar 2004
Textile printing project dr.azhar 2004Textile printing project dr.azhar 2004
Textile printing project dr.azhar 2004
 
Ppt compressed sensing a tutorial
Ppt compressed sensing a tutorialPpt compressed sensing a tutorial
Ppt compressed sensing a tutorial
 

Dernier

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Dernier (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

annalist - a statistics aggregator written in erlang

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n