Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo update #18

Merged
merged 36 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3261820
Removal of deprecated list of plugins. (#631)
rbourga Jan 12, 2024
e5efe45
Add vdn@github - elastic-apm-tool (#633)
vdaburon Feb 6, 2024
06ce323
Release redis 0.7
undera Feb 7, 2024
31311ce
add initial version of HAR Importer (#635)
besessener Feb 22, 2024
8e5fd38
added version 1.2.10 of jmeter-websocket-samplers plugin (#636)
ptrd Feb 22, 2024
b99730b
Add vdn@github - har-convertor-jmeter-tool (#638)
vdaburon Mar 11, 2024
e9d1359
Update version 2.0 for vdn@github - har-convertor-jmeter-tool (#639)
vdaburon Mar 12, 2024
f3c5bb9
RTE-Plugin v3.3 release (#640)
Baraujo25 Mar 13, 2024
105491f
Releasing Extended csv confg plugin v2.2 (#642)
rollno748 Mar 18, 2024
0e9d8ef
vdn-har-convertor-jmeter-tool v3.0 (#641)
vdaburon Mar 18, 2024
f176594
Correlation Recorder 2.3 (#643)
3dgiordano Mar 18, 2024
4aa8db6
Parallel Plugin release v0.12 (#644)
Baraujo25 Mar 18, 2024
bc0470a
BlazeMeter Repositories 1.2 (#645)
gamorin Mar 19, 2024
09d34c0
Release SSHMon plugin (#647)
tilln Mar 23, 2024
ef5f339
vdn-har-convertor-jmeter-tool v3.2 (#648)
vdaburon Mar 30, 2024
31e6167
Correlation recorder 2.4 (#649)
diego-ferrand Apr 15, 2024
038e3da
Version 5.0 har-convertor-jmeter-plugin (#650)
vdaburon May 10, 2024
4b16127
HAR Importer v0.2.0 added (#651)
besessener May 15, 2024
4360fa2
add HAR importer 0.2.1 (#652)
besessener May 15, 2024
df152e3
add HAR importer 0.2.2 (#653)
besessener May 15, 2024
a90a0a5
version 5.1 vdn-har-convertor-jmeter-tool (#654)
vdaburon May 18, 2024
34d4518
Correlation Recorder v2.5 (#655)
Baraujo25 May 27, 2024
a87ed59
Fix news/changes on release v2.5 (#656)
Baraujo25 May 27, 2024
b714b10
Cleanup some old versions to save repo size
undera Jun 2, 2024
45bfc7d
Release UbikLoadPack Video Streaming plugin 9.1.5 (#657)
pmouawad Jun 14, 2024
8d36da5
Update vdn-har-convertor-jmeter-tool version 5.2 (#658)
vdaburon Jun 22, 2024
888ee23
Rebranding 'Correlation Recorder' to 'Auto Correlation Recorder' (#659)
Baraujo25 Jun 29, 2024
956a44d
CorrelationRecorder v2.5.1 release (#662)
Baraujo25 Jul 3, 2024
fff04db
update har importer to 0.2.3 (#664)
besessener Jul 19, 2024
0c27bed
CorrelationRecorder v2.6 release (#666)
Baraujo25 Aug 25, 2024
f1edd46
update har importer to v0.2.5 (#667)
besessener Aug 25, 2024
59c7bb7
JmeterNamesTemplater v1.1 and UtilityJmeterFunctions v1.1.3 (#665)
DanilGolikov Aug 25, 2024
908bf69
Release webdriver
undera Aug 29, 2024
a7d0124
Merge branch 'master' of github.com:undera/jmeter-plugins
undera Aug 29, 2024
3f0a9ef
Add CORS Plugin (#668)
tilln Sep 4, 2024
ba07004
Fix for Throughput Shaping Timer for unexpected test break before con…
Coder1304 Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-redis</artifactId>
<version>0.6</version>
<version>0.7</version>


<name>Redis</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@

package kg.apc.jmeter.config.redis;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.security.GeneralSecurityException;
import java.util.ResourceBundle;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocketFactory;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.apache.jmeter.config.ConfigTestElement;
import org.apache.jmeter.engine.event.LoopIterationEvent;
Expand All @@ -44,65 +32,69 @@
import org.apache.jmeter.threads.JMeterVariables;
import org.apache.jmeter.util.JsseSSLManager;
import org.apache.jmeter.util.SSLManager;
import org.slf4j.LoggerFactory;
import org.apache.jorphan.util.JMeterStopThreadException;
import org.apache.jorphan.util.JOrphanUtils;
import org.slf4j.Logger;

import org.slf4j.LoggerFactory;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.args.ListDirection;
import redis.clients.jedis.exceptions.JedisDataException;

import javax.net.ssl.*;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.security.GeneralSecurityException;
import java.util.ResourceBundle;

/**
* Redis DataSet using a Redis Set or List.
*
* @since 2.11
*/
public class RedisDataSet extends ConfigTestElement
implements TestBean, LoopIterationListener, NoConfigMerge, TestStateListener {


private interface PollingStrategy {
public String getDataFromConnection(Jedis conn, String key) throws JedisDataException;
String getDataFromConnection(Jedis conn, String key) throws JedisDataException;
}

/**
* Pops an element from a redis list from right (LIFO)
* Pops an element from a redis list from right (LIFO)
*/
private class PopFromListStrategy implements PollingStrategy {
@Override
public String getDataFromConnection(Jedis conn, String key) throws JedisDataException {
log.debug("Executing lpop against redis list");
String line = conn.lpop(key);
return line;
return conn.lpop(key);
}
}

private class QueueStrategy implements PollingStrategy {
@Override
public String getDataFromConnection(Jedis conn, String key) throws JedisDataException {
log.debug("Executing lmove against redis list");
String line = conn.lmove(key, key, ListDirection.RIGHT, ListDirection.LEFT);
return line;
return conn.lmove(key, key, ListDirection.RIGHT, ListDirection.LEFT);
}
}

private class PopFromSetStrategy implements PollingStrategy {
@Override
public String getDataFromConnection(Jedis conn, String key) throws JedisDataException {
log.debug("Executing spop against redis set");
String line = conn.spop(key);
return line;
return conn.spop(key);
}
}

private class CopyFromSetStrategy implements PollingStrategy {
@Override
public String getDataFromConnection(Jedis conn, String key) throws JedisDataException {
log.debug("Executing srandmember against redis set");
String line = conn.srandmember(key);
return line;
return conn.srandmember(key);
}
}

Expand Down Expand Up @@ -130,15 +122,21 @@ public String getDataFromConnection(Jedis conn, String key) throws JedisDataExce
}

public enum RedisDataType {
REDIS_DATA_TYPE_LIST((byte)0),
REDIS_DATA_TYPE_SET((byte)1);
REDIS_DATA_TYPE_LIST((byte) 0),
REDIS_DATA_TYPE_SET((byte) 1);

private final byte value;

private byte value;
RedisDataType(byte value) { this.value = value; }
public int getValue() { return value; }
RedisDataType(byte value) {
this.value = value;
}

public int getValue() {
return value;
}
}

private PollingStrategy selectPollingStrategy(){
private PollingStrategy selectPollingStrategy() {

switch (redisDataType) {
case REDIS_DATA_TYPE_SET:
Expand All @@ -154,7 +152,7 @@ private PollingStrategy selectPollingStrategy(){
if (!getRecycleDataOnUse()) {
return new PopFromListStrategy();
} else {
if (getPropertyAsBoolean("plugins.redis.legacy", false)){
if (getPropertyAsBoolean("plugins.redis.legacy", false)) {
return new PopAndPushBackListStrategy();
}
return new QueueStrategy();
Expand Down Expand Up @@ -255,8 +253,8 @@ public void testEnded() {
@Override
public void testEnded(String host) {
int idleConn = pool.getNumIdle();
for(int i=0;i<idleConn;i++){
pool.getResource();
for (int i = 0; i < idleConn; i++) {
pool.getResource();
}
pool.destroy();
}
Expand All @@ -268,7 +266,7 @@ public void testStarted() {

@Override
public Object clone() {
RedisDataSet clonedElement = (RedisDataSet)super.clone();
RedisDataSet clonedElement = (RedisDataSet) super.clone();
clonedElement.pool = this.pool;
return clonedElement;

Expand All @@ -291,12 +289,12 @@ public void setProperty(JMeterProperty property) {
try {
final BeanInfo beanInfo = Introspector.getBeanInfo(this.getClass());
final ResourceBundle rb = (ResourceBundle) beanInfo.getBeanDescriptor().getValue(GenericTestBeanCustomizer.RESOURCE_BUNDLE);
for(Enum<RedisDataType> e : RedisDataType.values()) {
for (Enum<RedisDataType> e : RedisDataType.values()) {
final String propName = e.toString();
if (objectValue.equals(rb.getObject(propName))) {
final int tmpType = e.ordinal();
if (log.isDebugEnabled()) {
log.debug("Converted " + pn + "=" + objectValue + " to data type=" + tmpType + " using Locale: " + rb.getLocale());
log.debug("Converted " + pn + "=" + objectValue + " to data type=" + tmpType + " using Locale: " + rb.getLocale());
}
super.setProperty(pn, tmpType);
return;
Expand Down Expand Up @@ -328,19 +326,19 @@ public void testStarted(String distributedHost) {
config.setSoftMinEvictableIdleTimeMillis(getSoftMinEvictableIdleTimeMillis());

int port = Protocol.DEFAULT_PORT;
if(!JOrphanUtils.isBlank(this.port)) {
if (!JOrphanUtils.isBlank(this.port)) {
port = Integer.parseInt(this.port);
}
int timeout = Protocol.DEFAULT_TIMEOUT;
if(!JOrphanUtils.isBlank(this.timeout)) {
if (!JOrphanUtils.isBlank(this.timeout)) {
timeout = Integer.parseInt(this.timeout);
}
int database = Protocol.DEFAULT_DATABASE;
if(!JOrphanUtils.isBlank(this.database)) {
if (!JOrphanUtils.isBlank(this.database)) {
database = Integer.parseInt(this.database);
}
String password = null;
if(!JOrphanUtils.isBlank(this.password)) {
if (!JOrphanUtils.isBlank(this.password)) {
password = this.password;
}
SSLSocketFactory sslSocketFactory = null;
Expand All @@ -349,11 +347,11 @@ public void testStarted(String distributedHost) {
if (this.ssl) {
SSLManager sslManager = SSLManager.getInstance();
try {
SSLContext sslContext = ((JsseSSLManager)sslManager).getContext();
SSLContext sslContext = ((JsseSSLManager) sslManager).getContext();
sslSocketFactory = sslContext.getSocketFactory();
sslParameters = sslContext.getDefaultSSLParameters();
hostnameVerifier = HttpsURLConnection.getDefaultHostnameVerifier();
}catch(GeneralSecurityException ex) {
} catch (GeneralSecurityException ex) {
throw new IllegalStateException("Unable to get SSLContext from SSLManager", ex);
}
}
Expand Down Expand Up @@ -656,34 +654,18 @@ public void setSoftMinEvictableIdleTimeMillis(
this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
}

/**
*
* @return
*/
public boolean getRecycleDataOnUse() {
return recycleDataOnUse;
}

/**
*
* @param recycleDataOnUse
*/
public void setRecycleDataOnUse(boolean recycleDataOnUse) {
this.recycleDataOnUse = recycleDataOnUse;
}

/**
*
* @return
*/
public int getRedisDataType() {
return redisDataType.ordinal();
}

/**
*
* @param dataType
*/
public void setRedisDataType(int dataType) {
try {
this.redisDataType = RedisDataType.values()[dataType];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public VariableThroughputTimer() {
*/
public synchronized long delay() {
while (true) {
long curTimeMs = System.currentTimeMillis();
long curTimeMs = System.nanoTime() / 1_000_000;
long millisSinceLastSecond = curTimeMs % 1000;
long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond;
checkNextSecond(nowInMsRoundedAtSec);
Expand Down
Loading
Loading