JMeter testing
JMeter is a testing tool to simulate thousands of users for web testing purposes. It uses Java Threads for this.
JMeter is a testing tool to simulate thousands of users for web testing purposes. It uses Java Threads for this.
We’re going to use a test app. Supposedly, this app has passed a first development iteration, and has passed unit and functional testing. With JMeter we measure its performance.
Performance testing should start early and continue through the whole dev process.
JMeter is not a browser. It doesn’t execute JavaScript!
Performance is related to how fast an app executes an operation. Performance testing is about how an app or resource performs under a given load, to see its impact. It should be done after the app has passed all functional tests and we’re sure it works correctly.
Performance testing is measured in terms of:
scalability: tells how well the system expands its capacity in terms of response time, throughput and reliability when additional resources are added.
They’re are usually set up in contracts, such as:
Almost always you should execute a smoke test first. This is a test with light load to verify the test works correctly.
A load test is a test that’s performed at a specific load level. Usually you’ll perform them at many load levels to monitor the app’s behavior.
A stress test tests the app with loads past its normal working range, to see up to which point it stays stable and responsive.
At a spike test the app is subjected to brief periods of sudden increments in the load beyond its maximum capacity, to see if the app is robust enough to work during and after the spike.
Endurance tests, where the app is subjected to load within its limits for a long duration (hours or even days) to search for memory leaks.
JMeter is a testing tool to simulate thousands of users. It uses Java Threads for this.
In JMeter the components of a test are organized in a tree, where each component has a scope that determines to what other components it has access to.
Test Plan is the root element of a test, where all overall settings are specified and all the other elements are contained.
It allows us to:
They’re the entry point of a test and controls the number of threads (users) JMeter will use to execute a test. We also have setUp and tearDown Thread Groups.
We may:
They’re used to set up default configurations and variables for later use by other components. They can be placed under any other component.
They are classified into:
The most common used are:
He created an HTTP Request Defaults and added the IP and port number, so he doesn’t need to repeate this at every component.
Splunk take any type of data of millions of entries and allows you to process it into reports, dashboards and alerts.
It’s great at parsing machine data. We can train Splunk to look for certain patterns in data and label those patterns as fields.
Everything Splunk does is governed by configuration files. They’re stored in /etc
and they’ve .conf
extension.
They’re layered. You can have files with the same name in several directories. You might have a global level conf file and an app specific conf file. Splunk check which one to use based on the current app.
List of things to do, to improve your Docker experience
If you map it, you’ll only be able to have one instance of this container running. If the user wants to map the port, he’ll be able to do it in a compose
script or with -p
option.
# public and private mapping
EXPOSE 80:8080 # don't do this
# private mapping
EXPOSE 80
Working docker-compose and DockerFile examples to complement this information
Interesting tool to analyze custom Image layers size
Image Executable package that includes everything needed to run an application. It consists of read-only layers, each of which represent a DockerFile instruction. The layers are stacked and each one is a delta of changes from the previous layer.
Container Instance of an image.
Stack Defines the interaction of all the services
Services Image for a microservice which defines how containers behave in production
DockerFile File with instructions that allows us to build upon an already existing image. It defines:
At the end, a DockerFile will form a service, which we may call from docker-compose or standalone with docker build
.
DockerFiles vs docker-compose A DockerFile is used when managing a single individual container. docker-compose is used to manage an application, which may be formed by one or more DockerFiles. Docker-compose may also be used as support to input large customization options, which otherwise would be parameters in a really long command.
You can do everything docker-compose does with just docker commands and a lot of shell scripting
git config -l
git config --global user.name "newName"
git config --global user.mail "new@mail.com"
Is a tool to find the exact commit where a bug was introduced.
I have a file with the following content and an obvious bug
Row row row your car at the river
How to grant privileges for a database to a user, when both already exist.
In this case the database name will be project_node1
, the user project_user
and the password project_pass
. All the following commands have to be executed as root
or with a user with enough privileges.
-- list system users
SELECT user, host FROM mysql.user;
-- see current privileges
SHOW GRANTS FOR 'project_user'@'%';
-- delete all previous privileges (if needed)
-- REVOKE ALL PRIVILEGES ON `project_node1`.* FROM 'project_user'@'%';
-- grant new privileges and flush
GRANT ALL PRIVILEGES ON `project_node1`.* TO 'project_user'@'%';
FLUSH PRIVILEGES;
Config. to run MongoDB
PATH
as system variable (~/.bashrc
)/data/db
and set rw-
permissions to correct user.mongod
db.getCollection('documentX').find({ _id : ObjectId("5b7e99a9149559198c5024a4") })
Connect to DB from CLI
mysql -u {$user} -p
See current logged user SELECT CURRENT_USER();
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myNewPassword');
SHOW DATABASES;
USE {$db};
SHOW TABLES;
DESCRIBE {$db}
CREATE TABLE table_name (
id numeric,
description text);
To check all the errors in checkstyle and where they’re located:
target/checkstyle-result.xml
="error"
To find where the error is located. Search for the String priority="1"
. If nothing is found, search for prio 2, 3…
mvn liquibase:clearCheckSums
mvn liquibase:dropAll
This will delete the whole DBDATABASECHANGELOCK