question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] What's the overhead of having spy.create() in production?

See original GitHub issue

Trying to decide whether to enable rxjs-spy in production. Ideally we would like to have it there in order to inspect our streams, but it doesn’t say much in the docs about how significant the overhead is.

The only code that would run in production is spy.create() and tag() on streams, but as far as I understand rxjs-spy patches Observable.subscribe, so perhaps this isn’t very desirable.

Any thoughts on this? 😃

We’ve tried exposing spy.create in production, but the issue then is that if we create the spy later, we lose out on tagging a lot of streams that have already been created.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
cartantcommented, Jul 26, 2019

It’s not mentioned because it’s not at all recommended. When it’s enabled/created everything runs through it. Everything. tag operators have essentially no overhead - as they are little more than annotations - but you definitely do not want to create a spy in a production environment.

Anyway, rxjs-spy is going to be deprecated soon and with its replacement - the RxJS DevTools I’m working on - you will be able to do what you want in a production environment with no overhead if the DevTools are not installed.

1reaction
cartantcommented, Aug 14, 2019

… I’m working on

… in a private repo.

I’ll be presenting a talk on the DevTools at RxJS Live - in Las Vegas - in September. Expect more information regarding the tools - and a beta release - to be made available around the time of the talk.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding performance bottlenecks in Celery tasks
Learn how to speed up Celery tasks by figuring out what's causing them to be slow.
Read more >
A Unit Testing Practitioner's Guide to Everyday Mockito - Toptal
To create a spy, you need to call Mockito's static method spy() and pass it an instance to spy on. Calling methods of...
Read more >
CS 419 Final Exam Study Guide
Disclaimer: This study guide attempts to touch upon the most important topics that may be covered on the final exam but does not...
Read more >
How to Find Out the Bottleneck of My Python Code
More often than not, developers need to optimize the code to make it ... profiling has to be a continuous process in production...
Read more >
What's the difference between a mock & stub? - Stack Overflow
Both mocks and stubs testing give an answer for the question: What is the ... Example: Your test class depends on a method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found