Performance monitoring - influxDB database

InfluxDB is a time series database written in Go language, which is used to handle massive writes and load queries. Any use case involving large amounts of time-stamped data (including DevOps monitoring, application metrics, etc.). I think the biggest feature of InfluxDB is its high-performance read and write capabilities when facing massive data in time series, which is very suitable for data storage in performance testing scenarios.

Official documentation: Install InfluxDB | InfluxDB OSS 2.7 Documentation

Reference document: https://www.cnblogs.com/wangguishe/p/17255638.html#_label0

Note that you need to choose according to your own linux architecture. This article uses the linux operating system when redhat

Install influxDB

Install as a service

wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.7.0.x86_64.rpm
sudo yum localinstall influxdb2-2.7.0.x86_64.rpm
sudo service influxdb start

The connection timed out and failed for unknown reasons. (It also timed out during yum installation, but it prompts that the installation was successful.)

For a redhat machine, a successful re-installation.

Check service status

sudo service influxdb status

Install command line tools

Install and use the influx CLI | InfluxDB OSS 2.7 Documentation

wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-linux-amd64.tar.gz
tar xvzf path/to/influxdb2-client-2.7.3-linux-amd64.tar.gz
sudo cp influxdb2-client-2.7.3-linux-amd64/influx /usr/local/bin/ #复制至path路径

configure influxdb

influx setup \
  --username USERNAME \
  --password PASSWORD \
  --token TOKEN \
  --org ORGANIZATION_NAME \
  --bucket BUCKET_NAME \
  --force

After configuration, influx will generate a configuration file.

Once you have a provisioning profile, you can create a full access token or start collecting and writing data

View Influx CLI configs

# cat /root/.influxdbv2/configs

 

 Visit the InfluxDB dashboard

http://localhost:8086 account password is the account password created during setup

influxQL

https://www.cnblogs.com/wangguishe/p/17256090.html

Influx Query Language (InfluxQL) reference | InfluxDB OSS 1.8 Documentation

In linux, use the following command to enter the statement and enter the command line 

influx v1 shell

Create database prompt Error: not implemented: CREATE DATABASE

  1. You are using InfluxDB 2.x version: In InfluxDB 2.x version, the CREATE DATABASE command is no longer used to create the database. Instead, use the new API provided by InfluxDB 2.x for database management. You can create databases using the InfluxDB 2.x API or web interface.

 data input

API method

Write data with the InfluxDB API | InfluxDB OSS 2.7 Documentation (influxdata.com)

Data can be written to influxdb using the API method

1. Create an API token, which can be created using APIToken on the UI interface

2. Use the HTTP request to correspond to the API interface

 

 

The body is text, and the meanings of each field are as follows:

After sending the request, use the statement to query the database, you can see the sent data

 Configure Jmeter

Write data with no-code third-party technologies | InfluxDB OSS 2.7 Documentation (influxdata.com)

1. Add a backend listener

InfluxDBBackendListenerClient

2. Check parameters

  • influxdbMetricsSender:

org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender

  • influxdbUrl:
http://host:8086/api/v2/write?org=my-org&bucket=jmeter
  • application: InfluxDB2
  • influxdbToken: created API token
  • measurement: jmeter indicates the created table name

 

Run the test to see if there is an error in the jmeter log

 Enter the query statement after linux enters influxQL

select * from jmeter;

 You can see 5 pieces of data, 3 of which are the 90% 95% 99% percentile response time corresponding to the interface.

 

Guess you like

Origin blog.csdn.net/seanyang_/article/details/132103200