O'Reilly logo

Crafting Rails 4 Applications, 2nd Edition by José Valim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrapping Up

In this chapter, we developed a Rails engine that listens to all actions an application processes, and stores them in MongoDB. We can see these notifications by accessing /mongo_metrics in the browser.

Our implementation was built atop a mountable and isolated engine, which allows us to build our features isolated from a Rails application, guaranteeing we won’t have conflicts in the most likely places, such as routes and helpers. We also explored Rack by creating middleware that allows us to mute the metrics storage on particular areas of our plug-in and by using a custom Rack body to stream data.

There’s still a lot to be done in our plug-in when it comes to the visualization part. We could, for instance, allow the developer to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required