DEV Community

Arpit Mohan
Arpit Mohan

Posted on • Originally published at insnippets.com

About WebPerf Metrics; Chaos engineering traps; & Lambdas

TL;DR style notes from articles I read today.

Performance metrics for blazingly fast web apps

  • Measure time starting at event.timeStamp.
  • Measure time ending at performance.now() in a requestAnimationFrame(). performance.now() is precise to Β±100 microseconds.
  • Ensure your app is in the foreground because if your user switches to another browser tab, your metrics will break. Use document.hidden and visibilitychange event. While the tab is in the background, document.hidden is true.
  • Find the best event start time. For a current event, use window.event.timeStamp to record the time the system logged the event.

Full post here, 8 mins read


Chaos engineering traps

  • Success can be measured by the number of vulnerabilities you find.
  • Not all people who work on the service need to be involved in the experiment & in the preparation.
  • Chaos engineers should be rule enforcers.
  • You should fix the vulnerabilities you find - and if you can, automate the fixes.
  • The most important part is running the experiment.
  • You can worry about safety later.
  • It is okay to be a little lenient about the definition of the β€˜steady state’.
  • There is a prescriptive formula for doing chaos engineering.

Full post here, 17 mins read


Lambdas are not functional programming

Rather than spending time trying tricks with Lambdas, you should:

  • Make good use of Generic Types. Declare type parameters & enforce them everywhere. Minimize casting and if instanceOfing.
  • Make illegal states unrepresentable in code.
  • Make your own data classes immutable and final where possible, use - proper immutable collections.
  • Use libraries that avoid runtime magic and reflection where pragmatically possible.

Full post here, 9 mins read


I share these TL;DR versions of articles on software engineering that I read every weekday through my newsletter - in.snippets(). Sign up here if you liked what you just read.

Top comments (1)

Collapse
 
loujaybee profile image
Lou (πŸš€ Open Up The Cloud ☁️)

This is a pretty neat idea, Arpit!

Kinda reminds me of this website: fourminutebooks.com it might give you some ideas.

It'd be nice if you did a little summary to give the points a bit of context too!