Want this course?
Course: JVM Fundamentals for Clojure
If you're running a system in production, you'll want to keep an eye on it 24 hours per day. There are now cloud monitoring options that collect information from your JVM all the time and will send alerts.
So if you're going to be running a JVM in production, if you got closure on it, you're running in production, you probably want to be monitoring it actively all the time. There are several options that are cloud based that can help you do this and organize all that information to make it useful for you.
One I've used before is called New Relic. I think it's one of the bigger ones. It works with a bunch of different systems, Ruby, Java, Node, and it's mainly about performance, so it'll show you like how much garbage collection happened, how much CPU was being used, all those kinds of things, and then it gives it to you in a nice dashboard, you know, and it'll send you e-mails of alerts, or maybe a daily status report, something like that. It uses what's called the Java agent, which is some code that runs alongside your code and, you know, puts the instrumentation in.
It's got some other features. It's not, you know, I can't do it justice right here, so you should check it out. Now another one that might be better for some other options, like if you've got, if you wanna know all the exceptions thrown, this one called OverOps, I've played with it. I've never run it in production. But it shows you, it's customized for closure. It also has Scala. But it shows you all of the information that led up to an exception. So when an exception is thrown, you might not have the whole stack tray. Or you have the stack trays, but you don't have all the variables. But this lets you step through all the variables, and you can see here they got recorded when the exception was thrown.
So you know the value of the thing that was throwing the exception, and you can see the actual source code and what line in closure. I don't think New Relic will do that. I think it's much more like "Hey, this thread was pegging the CPU for too long" or "It was generating a lot of garbage," something like that. This OverOps is much better for finding those exceptions and then debugging them. Because once, you know, it's happening on the server, once it's happened, you can't go back and figure out what was going on. They're very hard to reproduce in development. So those are two options.
There are a bunch of others. It's very common to have a cloud-based system that will do this, you know, logging system that will go to the cloud instead of logging to a file, those kind of things. But these are two options. You should check them out, and let me know which you like best, because I'm always interested in finding out this stuff, like which one actually saves you time and helps you in the long run.
Creating a Clojure Library for use in Java
Have you ever wanted to solve a problem with your Java app by using Clojure? Have you ever wanted to "sneak in" a dependency on the Clojure JAR but didn't know what to do with it once it was there? This lesson shows you how to create a Clojure library that you can use from Java.