Skip to content

Instantly share code, notes, and snippets.

Avatar

Smirnov Viacheslav polarnik

View GitHub Profile
View DebugApp.java
import io.gatling.app.Gatling;
import org.junit.jupiter.api.Test;
import scala.collection.mutable.HashMap;
public class DebugApp {
final private HashMap<String, String> config = new HashMap<>();
{
// default values
config.put("gatling.core.directory.resources", IDEPathHelper.resourcesDirectory.toString());
View do_vm_query.py
import pandas as pd
import requests
def do_vm_query(queryText: str, http: requests.sessions) -> pd.DataFrame:
params = {
'query': queryText
}
response = http.get(
'http://test-victoria-metric-server:8428/api/v1/query',
params=params
@polarnik
polarnik / 1. Register Custom Hotkey Alt+G.cs
Last active Jun 1, 2022
Fiddler 4 Classic. WebSocket test Generator
View 1. Register Custom Hotkey Alt+G.cs
// https://www.telerik.com/blogs/what-s-new-in-fiddler-2-4-4-5
public static void Main() {
// ...
FiddlerApplication.UI   
.RegisterCustomHotkey(
HotkeyModifiers.Alt,    
Keys.G,
"Generate"
);
@polarnik
polarnik / JSR223 Listener - Transaction Duration Assertion.groovy
Last active Dec 24, 2020
SLA for Transaction Controller (name like "* (TC)") via Apache.JMeter JSR223 Listener
View JSR223 Listener - Transaction Duration Assertion.groovy
if(sampleResult.getSampleLabel().endsWith(' (TC)'))
{
Long maxDuration = Long.valueOf(Parameters)
if(sampleResult.getTime() > maxDuration)
{
sampleResult.setResponseMessage("Timeout Assertion Error time > ${Parameters}")
sampleResult.setResponseCode('503.1')
sampleResult.setSuccessful(false)
}
@polarnik
polarnik / gist:0efdfe115d75ec9acc91ef9f8bbd6a46
Created Dec 21, 2020 — forked from bjkmd/gist:fdf13edde8f14ec825be8fd9e3fc40a3
Jenkins pipeline for comparing jmeter results
View gist:0efdfe115d75ec9acc91ef9f8bbd6a46
node('master') {
        properties(
            [
                    parameters([
                            string(defaultValue: 'run_performance_tests', description: 'Jenkins job to take results from', name: 'Job'),
                            string(defaultValue: '10', description: 'Build number from the job', name: 'FirstBuild'),
                            string(defaultValue: '11', description: 'Build number from the job', name: 'SecondBuild')
                    ])
            ])
@polarnik
polarnik / check.groovy
Last active Oct 5, 2020
JMeter Script Engine Check compilable
View check.groovy
import java.util.*;
import javax.script.*;
ScriptEngineManager mgr = new ScriptEngineManager();
List<ScriptEngineFactory> factories = mgr.getEngineFactories();
String [] javaProps = ["java.runtime.name", "java.runtime.version",
"java.specification.name", "java.specification.vendor", "java.specification.version",
"java.vendor", "java.vendor.url", "java.version", "java.version.date", "java.vm.name"];
@polarnik
polarnik / Grafana-Table-Old-with-link.json
Last active Jun 17, 2020
Grafana-Table-Old-with-link.json
View Grafana-Table-Old-with-link.json
@polarnik
polarnik / README.md
Created May 19, 2020
Перехват net.tcp трафика для Microsoft Dynamics NAV 2018 с помощью CANAPE Network Testing Tool
View README.md

Настройка перенаправления портов

Посмотреть свой сетевой адрес

C:\Windows\system32>ipconfig | findstr "IPv4"
   IPv4 Address. . . . . . . . . . . : 10.0.2.15
   Autoconfiguration IPv4 Address. . : 169.254.188.161

Выберем адрес 10.0.2.15 для экспериментов. Настроим перенаправление с 10.0.2.15:7046 на 127.0.0.1:9046

@polarnik
polarnik / property.30.jmx
Last active Apr 30, 2020
JMeter: errorlevel=-1073741819 when start jmeter gui with too many -J agruments: Источник: https://t.me/qa_load/20875
View property.30.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
View BasicSimulation.scala
package qaload
import java.text.SimpleDateFormat
import java.util.Calendar
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._