SlideShare a Scribd company logo
spy-js
#dddbne
@ArtemGovorov
@JetBrains
JavaScript tracing, debugging, profiling made simple with spy-js
piece of wisdom
the philosophy of JavaScript (to
the extent that it has any
philosophy) is that you should
not be able to observe what is
going on
demo
in a nutshell
javascript developer
opens a web page via smart proxy
!

the proxy injects some special code
into each script of the page
!

the script code executes and sends
runtime data back to the proxy
!

IDE gets notified when new event data
is available and can request full call
stack

typical JS dev
proxy
Local
virtually no configuration required,
but more fragile
!

System
OS/browser configuration required,
but more reliable
instrumentor

code + regular expression =

syntax tree
instrumentor
code parsing
AST traversing
AST modification
code generation
prettifying
parallel processing
quiz #1
Wrapping any loop statement into a block can not
break the loop code, true or false?
quiz #1
Wrapping any loop statement into a block can not
break the loop code, true or false?
tracer
cross-browser

simple

fast
tracer
fast, simple, cross-browser
tracer
app code
objects dumper

event queue

app code
timer
app code

back-end
quiz #2
Each function expression or function declaration in
JavaScript must have “function” keyword, true or
false?
quiz #2
Each function expression or function declaration in
JavaScript must have “function” keyword, true or
false?
back-end and UI
processing and persisting trace
!

serving UI and tracer requests

events tree

!

stack tree

infrastructure (sessions, proxy
and instrumentor hosting)

code
quiz #3
this is how spy-js works: my web page is
parsed into some tree using horse.js
framework and then the awesome cat
on the unicorn sends my data to the
WebStorm
quiz #3
this is how spy-js works: my web page is
parsed into some tree using horse.js
framework and then the awesome cat
on the unicorn sends my data to the
WebStorm

NO
quiz #3
javascript developer opens web page via proxy

the back-end proxy modifies requested javascript
files using instrumentor

the instrumentor changes the page code to collect
runtime data and injects tracer code

javascript developer executes some scenario on the
page (or runs tests) and the tracer sends collected
runtime data to the back-end

YES
future
nodejs, packaged javascript apps
!

collected runtime information analysis and presentation
!

advanced proxying
!

extensible instrumentation/code injection
when
WebStorm 8 EAP starts Jan 2014
!

visit spy-js.com to get a web UI based version today
questions

More Related Content

Viewers also liked (7)

KEY
New Perspectives on Performance
mennovanslooten
 
PDF
Debugging Javascript
SolTech, Inc.
 
PDF
Debugging JavaScript (by Thomas Bindzus, Founder, Vinagility & Thanh Loc Vo, ...
JavaScript Meetup HCMC
 
PDF
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar
 
ODP
Middle school math quiz
ITfC-Edu-Team
 
PDF
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
Xiaozhe Wang
 
PDF
Linux Profiling at Netflix
Brendan Gregg
 
New Perspectives on Performance
mennovanslooten
 
Debugging Javascript
SolTech, Inc.
 
Debugging JavaScript (by Thomas Bindzus, Founder, Vinagility & Thanh Loc Vo, ...
JavaScript Meetup HCMC
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar
 
Middle school math quiz
ITfC-Edu-Team
 
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
Xiaozhe Wang
 
Linux Profiling at Netflix
Brendan Gregg
 

Similar to JavaScript tracing, debugging, profiling made simple with spy-js (20)

PDF
End-to-end HTML5 APIs - The Geek Gathering 2013
Alexandre Morgaut
 
PPTX
Sherlock Homepage - A detective story about running large web services - WebN...
Maarten Balliauw
 
PPTX
Web Application Defences
Damilola Longe, CISSP, CCSP, MSc
 
PPTX
Sherlock Homepage (Maarten Balliauw)
Visug
 
PPTX
Sherlock Homepage - A detective story about running large web services (VISUG...
Maarten Balliauw
 
PDF
Analyzing the Performance of Mobile Web
Ariya Hidayat
 
PPTX
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
Yottaa
 
PDF
Webové aplikace v JavaScriptu
Pavol Hejný
 
PDF
Huge web apps web expo 2013
Daniel Steigerwald
 
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
PDF
Application Security Workshop
Priyanka Aash
 
PPTX
Developing Social VR with Open Source Software
Liv Erickson
 
PPT
JavaScript 2.0 in Dreamweaver CS4
alexsaves
 
PDF
Firefox OS, HTML5 pour le mobile - Code(love) Hackathon - 2014-05-28
Frédéric Harper
 
PPTX
Sherlock Homepage - A detective story about running large web services - NDC ...
Maarten Balliauw
 
PPTX
XSS Defence with @manicode and @eoinkeary
Eoin Keary
 
PPTX
Introduction to HTML5 & CSS3
Pravasini Sahoo
 
PPT
Pascarello_Investigating JavaScript and Ajax Security
amiable_indian
 
PDF
Be ef presentation-securitybyte2011-michele_orru
Michele Orru
 
PDF
Asfws 2014 slides why .net needs ma-cs and other serial(-ization) tales_v2.0
Cyber Security Alliance
 
End-to-end HTML5 APIs - The Geek Gathering 2013
Alexandre Morgaut
 
Sherlock Homepage - A detective story about running large web services - WebN...
Maarten Balliauw
 
Web Application Defences
Damilola Longe, CISSP, CCSP, MSc
 
Sherlock Homepage (Maarten Balliauw)
Visug
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Maarten Balliauw
 
Analyzing the Performance of Mobile Web
Ariya Hidayat
 
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
Yottaa
 
Webové aplikace v JavaScriptu
Pavol Hejný
 
Huge web apps web expo 2013
Daniel Steigerwald
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
Application Security Workshop
Priyanka Aash
 
Developing Social VR with Open Source Software
Liv Erickson
 
JavaScript 2.0 in Dreamweaver CS4
alexsaves
 
Firefox OS, HTML5 pour le mobile - Code(love) Hackathon - 2014-05-28
Frédéric Harper
 
Sherlock Homepage - A detective story about running large web services - NDC ...
Maarten Balliauw
 
XSS Defence with @manicode and @eoinkeary
Eoin Keary
 
Introduction to HTML5 & CSS3
Pravasini Sahoo
 
Pascarello_Investigating JavaScript and Ajax Security
amiable_indian
 
Be ef presentation-securitybyte2011-michele_orru
Michele Orru
 
Asfws 2014 slides why .net needs ma-cs and other serial(-ization) tales_v2.0
Cyber Security Alliance
 
Ad

Recently uploaded (20)

PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Python basic programing language for automation
DanialHabibi2
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Python basic programing language for automation
DanialHabibi2
 
Ad

JavaScript tracing, debugging, profiling made simple with spy-js