Instructor: So when talking about monitoring
what do we want to monitor?
What do we want to look at in our API?
So there are a lot of data that might be of interest for us.
Let's review some of it.
First, we want to know how many requests per second
our API is having.
That's an important information
because it'll help us understand what is the usage pattern
of our API and whether there are actual users using it.
In addition, we definitely want to know
the number of failures.
So for example, if we see that one out of 10 request fails,
then there is some problem with API that we must look at.
Latency is a very important factor.
Latency reflects the time a single request
takes to complete.
Or in other words, what is the performance of the API?
Now, we discussed performance in previous lectures,
so you already know how important it is
and the latency data can tell us
what is the actual performance of the API.
CPU is always important.
We need to know what is the average CPU utilization
of our servers and if it is too high,
then we will probably would like to scale out
and add more computer resources.
Number of users is great for our statistics,
so we can know if we have 100 users or 1 million users.
There is a huge difference between them.
And in addition to users,
we always want to know the number of sessions.
Now, the difference between users and sessions
is that users represent the number of unique users
and the sessions represent the number
of total requests of all users.
So if a single user performed five requests,
then he will be counted as one in the number of users
but as five in the number of sessions.
Geographic distribution is another interesting factor.
We always want to know where our users are coming from.
It can help us in decisions such as how to localize our API
or where to put our computer resources.
And last is the RAM, the memory.
We always need to keep an eye on our memory utilization,
and if it comes too high,
then we probably have a problem of a memory leak.
So here's an example of the monitoring
I have on my own website at memilavi.com.
So this specific monitoring displays
the failures my website experiences.
And you can see in the graph that on this specific day,
August 25, there were a few.
Now to be honest,
I don't really know what was the reason for that.
It is probably some kind of bot
that simply requested a non-existent address,
but it's still an important information.
And this is only a very, very small part of the monitoring
I have on my website.
So now let's have a demo of a basic monitoring
on the API we built in this course.