Performance testing using monitoring platform Grafana

Grafana monitoring is based on a database, server performance is acquired and stored in the database via the plug, and then connect to the database formed using Grafana visualized graph. Benpian tell you monitor the performance of the server, the next will introduce monitoring platform to build for the mysql database

Start

First click

 Select the red box then click AddQuery

 

At this point you can see the emergence of a chart, this is our last show of chart styles, this style can be changed according to the needs

 

 Click on the red box, this place is to select the database, that is, before you add data sources, we chose influxdb database

 

 Now we look at the contents of the red box, is not it look a bit familiar, yes this is the sql query, Grafana gives us a choice, if your sql can also be relatively strong in the back  they need to increase query

 

The first option cpu, there are other options such as men, io and so on here do not do the demo, where adding host Local host, select the host name in the back

 

After the first line is set up, we have to see the second line

The contents of the second line is more specific, I believe do performance testing of small partners have the understanding,

 

 

 Select the user, then we should be able to see the top of charts appeared data

 

 Explain to you the contents of the upper right corner of the red box. The first is the refresh interval data, I chose the last three hours of the show, you can make changes to the second refresh button that, when clicked, the icon can be specified refresh time, usually when we do performance testing is to choose 5s a refresh, we can play to our query a name alias by the

The following is the time to take more than a fine of data generally do not set up, so we've had the cpu monitoring. Here to talk about how to display multiple performance indicators in one chart, for example, I want to see it occupied cpu system

Click on the red box, add a query

 

 At this point one more found below query specific configuration is not talked about how, as with the above

 

Each line represents two lines of the different user and system memory occupied

How this time to tell you about the chart shows the settings

Click on the red box

 

 Click Visualization can change our style chart

 

This place has a relatively important for everyone to talk about

就是这个,这个选择决定了我们y轴的展示,里面选项很多不给大家一一介绍,举例我们的cpu是按照百分比来占用的,我们选择percent(0~100)看看效果

 

 

 

 在x轴上增加了百分比的显示,有些单位不准确的需要在这里修改为我们所需要的单位,里面参数很多大家自行拓展

再往下拉大家注意这几个指标

 

 相信不用我解释了都懂

这两个开关决定了展示数据的位置,一个是展示在右边,一个是依次显示在下方,不是横向展示而是纵向展示,具体效果大家自己去体验

 

点击红框给里面的title起个名,支持中文

 

 那么我们怎么保存这个查询呢?很简单ctrl+s 

 

 这个名字就是我们整个查询的名字而不是单一图表的名字,然后我们save。看下最后的效果

 

 

这样我们的一个监控就可以使用了,如果想再增加一个图表展示mem、io等数据,点击我上图红框的图标就可以增加一个新的图表,保存方式都是一样的。

最后给大家介绍一下模板,模板是什么,就是一些大神根据自己需要的数据定制做的一个监控平台,只要导入我们就可以使用比较方便快捷。怎么使用呢?

 

 点击+选择import 

点击

 

 导入我提供的json文件大家就可以使用了,记得选择数据源哟。连接附在最后,

给大家看下模板的效果

 

 

 

链接:https://pan.baidu.com/s/1QgK4BH8ooBv1719QM3hiCg
提取码:3afe

                          

  作者原创转载请注明出处

 

Guess you like

Origin www.cnblogs.com/congyiwei/p/12348213.html