Commit 8ec0f83a authored by ognivo777's avatar ognivo777

Revert to good version

parent f1acc9a8
Pipeline #225016635 failed with stage
in 4 minutes and 43 seconds
File mode changed from 100755 to 100644
image: maven:3.6-jdk-11
image: maven:3.3.9-jdk-8
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
......@@ -7,13 +7,13 @@ variables:
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository/
- target/
- .m2/repository/
- target/
deploy:
stage: deploy
script:
- gpg --batch --import <(echo "$GPG_PRIVATE_KEY")
- mvn $MAVEN_CLI_OPTS clean deploy
- gpg -v --import <(echo "$GPG_PRIVATE_KEY")
- mvn $MAVEN_CLI_OPTS clean deploy
only:
- master
- master
......@@ -2,14 +2,14 @@
xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>sonatype</id>
<id>ossrh</id>
<username>${env.MAVEN_REPO_USER}</username>
<password>${env.MAVEN_REPO_PASS}</password>
</server>
</servers>
<profiles>
<profile>
<id>sonatype</id>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
......
MIT License
Copyright (c) 2020 Testload
Copyright (c) 2018 Alex Babaev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -77,7 +77,7 @@
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="classname">cloud.testload.jmeter.ClickHouseBackendListenerWriter</stringProp>
<stringProp name="classname">cloud.testload.jmeter.ClickHouseBackendListenerClient</stringProp>
</BackendListener>
<hashTree/>
</hashTree>
......
# JMeter-Clickhouse-Listener
# JMeter-Listener
[![Maven Central](https://img.shields.io/maven-central/v/cloud.testload/jmeter-clickhouse-listener.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22cloud.testload%22%20AND%20a:%22jmeter-clickhouse-listener%22)
[![Javadocs](https://www.javadoc.io/badge/cloud.testload/jmeter-clickhouse-listener.svg)](https://www.javadoc.io/doc/cloud.testload/jmeter-clickhouse-listener)
![pipeline](https://gitlab.com/testload/jmeter-clickhouse-listener/badges/master/build.svg?job=build)
[![Maven Central](https://img.shields.io/maven-central/v/cloud.testload/jmeter.pack-listener.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22cloud.testload%22%20AND%20a:%22jmeter.pack-listener%22)
[![Javadocs](https://www.javadoc.io/badge/cloud.testload/jmeter.pack-listener.svg)](https://www.javadoc.io/doc/cloud.testload/jmeter.pack-listener)
![pipeline](https://gitlab.com/testload/jmeter-listener/badges/master/build.svg?job=build)
This JMeter Plugin allows to write load test data on-the-fly to ClickHouse
This JMeter Plugin allows to write load test data on-the-fly to ClickHouse, InfluxDB, ElasticSearch (This project is a partial fork of https://github.com/NovaTecConsulting/JMeter-InfluxDB-Writer and https://github.com/delirius325/jmeter-elasticsearch-backend-listener projects)
Explanations and usage examples on [project wiki](https://gitlab.com/testload/jmeter-clickhouse-listener/wikis/1.-Main).
Additional feature: aggregation of Samplers
Explanations and usage examples on [project wiki](https://gitlab.com/testload/jmeter-listener/wikis/1.-Main).
Strongly recommended use [clickhouse_bulk](https://github.com/nikepan/clickhouse-bulk) ([docker image](https://hub.docker.com/r/nikepan/clickhouse-bulk/)) - brilliant INSERT bulkizator for ClickHouse
UPD (03 JUNE 2019): New ClickHouseDB scheme used - jmresults(ops storage with extended data request/response)->jmresults_statistic(mat view as archive storage).
UPD (29 NOV 2019): V2 class!:
1. New scheme -
jmresults(memory buffer) ->
jmresults_data(temp ops storage with extended data request/response and TTL 7 days) ->
jmresults_statistic(mat view as archive storage)
+++ res_code field in database
2. Minus group_by .... Plus new "aggregate" log level
3. New error log level - like "info" but if error add Req/Resp
4. few memory usage optimizations
5. new Grafana dashboards (soon...)
Many thanks for support from:
[JetBrains](https://www.jetbrains.com/opensource/)
......
[
{
"_id": "c8cd6600-c41d-11e8-9f75-01aa2de32e20",
"_type": "dashboard",
"_source": {
"title": "JMeter statistic",
"hits": 0,
"description": "",
"panelsJSON": "[{\"panelIndex\":\"5\",\"gridData\":{\"x\":0,\"y\":4,\"w\":12,\"h\":4,\"i\":\"5\"},\"embeddableConfig\":{},\"id\":\"75196f90-c427-11e8-9f75-01aa2de32e20\",\"type\":\"visualization\",\"version\":\"6.4.0\"},{\"panelIndex\":\"6\",\"gridData\":{\"x\":4,\"y\":1,\"w\":8,\"h\":3,\"i\":\"6\"},\"embeddableConfig\":{\"vis\":{\"legendOpen\":false}},\"id\":\"2b3d8fa0-c42c-11e8-9f75-01aa2de32e20\",\"type\":\"visualization\",\"version\":\"6.4.0\"},{\"panelIndex\":\"7\",\"gridData\":{\"x\":0,\"y\":1,\"w\":4,\"h\":3,\"i\":\"7\"},\"embeddableConfig\":{\"vis\":{\"defaultColors\":{\"0 - 500\":\"rgb(165,0,38)\",\"1000 - 5000\":\"rgb(0,104,55)\",\"500 - 1000\":\"rgb(255,255,190)\"},\"legendOpen\":false}},\"id\":\"5acf15d0-c432-11e8-9f75-01aa2de32e20\",\"type\":\"visualization\",\"version\":\"6.4.0\"},{\"panelIndex\":\"8\",\"gridData\":{\"x\":0,\"y\":0,\"w\":12,\"h\":1,\"i\":\"8\"},\"version\":\"6.2.4\",\"type\":\"visualization\",\"id\":\"2cf97e60-eb66-11e8-892c-0191d6b4f25d\"}]",
"optionsJSON": "{\"darkTheme\":false,\"hidePanelTitles\":true,\"useMargins\":false}",
"version": 1,
"timeRestore": false,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}"
}
},
"_meta": {
"savedObjectVersion": 2
}
},
{
"_id": "5acf15d0-c432-11e8-9f75-01aa2de32e20",
"_type": "visualization",
"_source": {
"title": "Intensity",
"visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{\"customBucket\":{\"enabled\":true,\"id\":\"1-bucket\",\"params\":{\"customInterval\":\"30s\",\"extended_bounds\":{},\"field\":\"Timestamp\",\"interval\":\"m\",\"min_doc_count\":1},\"schema\":{\"aggFilter\":[],\"deprecate\":false,\"editor\":false,\"group\":\"none\",\"max\":null,\"min\":0,\"name\":\"bucketAgg\",\"params\":[],\"title\":\"Bucket Agg\"},\"type\":\"date_histogram\"},\"customLabel\":\"TPS\",\"customMetric\":{\"enabled\":true,\"id\":\"1-metric\",\"params\":{\"field\":\"SampleCount\",\"json\":\"{ \\\"script\\\" : \\\"_value/60\\\" }\"},\"schema\":{\"aggFilter\":[\"!top_hits\",\"!percentiles\",\"!percentile_ranks\",\"!median\",\"!std_dev\",\"!sum_bucket\",\"!avg_bucket\",\"!min_bucket\",\"!max_bucket\",\"!derivative\",\"!moving_avg\",\"!serial_diff\",\"!cumulative_sum\"],\"deprecate\":false,\"editor\":false,\"group\":\"none\",\"max\":null,\"min\":0,\"name\":\"metricAgg\",\"params\":[],\"title\":\"Metric Agg\"},\"type\":\"sum\"}},\"schema\":\"metric\",\"type\":\"avg_bucket\"}],\"params\":{\"addLegend\":true,\"addTooltip\":true,\"gauge\":{\"backStyle\":\"Full\",\"colorSchema\":\"Green to Red\",\"colorsRange\":[{\"from\":0,\"to\":500},{\"from\":500,\"to\":1000},{\"from\":1000,\"to\":5000}],\"extendRange\":true,\"gaugeColorMode\":\"Labels\",\"gaugeStyle\":\"Full\",\"gaugeType\":\"Arc\",\"invertColors\":true,\"labels\":{\"color\":\"black\",\"show\":true},\"orientation\":\"vertical\",\"percentageMode\":false,\"scale\":{\"color\":\"#333\",\"labels\":false,\"show\":true},\"style\":{\"bgColor\":false,\"bgFill\":\"#eee\",\"bgMask\":false,\"bgWidth\":0.9,\"fontSize\":60,\"labelColor\":true,\"mask\":false,\"maskBars\":50,\"subText\":\"\",\"width\":0.9},\"type\":\"meter\",\"verticalSplit\":false},\"isDisplayWarning\":false,\"type\":\"gauge\"},\"title\":\"Intensity\",\"type\":\"gauge\"}",
"uiStateJSON": "{\"vis\":{\"defaultColors\":{\"0 - 500\":\"rgb(165,0,38)\",\"500 - 1000\":\"rgb(255,255,190)\",\"1000 - 5000\":\"rgb(0,104,55)\"}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"ee1e1a40-eb63-11e8-892c-0191d6b4f25d\",\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
}
},
"_meta": {
"savedObjectVersion": 2
}
},
{
"_id": "2b3d8fa0-c42c-11e8-9f75-01aa2de32e20",
"_type": "visualization",
"_source": {
"title": "TPS",
"visState": "{\"title\":\"TPS\",\"type\":\"area\",\"params\":{\"type\":\"area\",\"grid\":{\"categoryLines\":true,\"style\":{\"color\":\"#eee\"},\"valueAxis\":\"ValueAxis-1\"},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"RightAxis-1\",\"type\":\"value\",\"position\":\"right\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"silhouette\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"TPS\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"histogram\",\"mode\":\"normal\",\"data\":{\"label\":\"TPS\",\"id\":\"1\"},\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"sum\",\"schema\":\"metric\",\"params\":{\"field\":\"SampleCount\",\"json\":\"{ \\\"script\\\" : \\\"_value/60\\\" }\",\"customLabel\":\"TPS\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"Timestamp\",\"interval\":\"m\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{},\"customLabel\":\".\"}}]}",
"uiStateJSON": "{\"vis\":{\"legendOpen\":false}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"ee1e1a40-eb63-11e8-892c-0191d6b4f25d\",\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
}
},
"_meta": {
"savedObjectVersion": 2
}
},
{
"_id": "2cf97e60-eb66-11e8-892c-0191d6b4f25d",
"_type": "visualization",
"_source": {
"title": "Controls",
"visState": "{\"title\":\"Controls\",\"type\":\"input_control_vis\",\"params\":{\"controls\":[{\"fieldName\":\"es-testName.keyword\",\"id\":\"1542568300307\",\"indexPattern\":\"ee1e1a40-eb63-11e8-892c-0191d6b4f25d\",\"label\":\"Profile\",\"options\":{\"multiselect\":true,\"order\":\"desc\",\"size\":5,\"type\":\"terms\"},\"type\":\"list\"},{\"id\":\"1542568419863\",\"indexPattern\":\"ee1e1a40-eb63-11e8-892c-0191d6b4f25d\",\"fieldName\":\"es-runid.keyword\",\"label\":\"RunId\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"size\":5,\"order\":\"desc\"}}],\"updateFiltersOnChange\":true,\"useTimeFilter\":true},\"aggs\":[]}",
"uiStateJSON": "{}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{}"
}
},
"_meta": {
"savedObjectVersion": 2
}
},
{
"_id": "75196f90-c427-11e8-9f75-01aa2de32e20",
"_type": "visualization",
"_source": {
"title": "Aggregate report",
"visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{\"customLabel\":\"Total\"},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"4\",\"params\":{\"customLabel\":\"Records\",\"field\":\"SampleCount\"},\"schema\":\"metric\",\"type\":\"sum\"},{\"enabled\":true,\"id\":\"6\",\"params\":{\"customBucket\":{\"enabled\":true,\"id\":\"6-bucket\",\"params\":{\"customInterval\":\"2h\",\"extended_bounds\":{},\"field\":\"Timestamp\",\"interval\":\"m\",\"min_doc_count\":1},\"schema\":{\"aggFilter\":[],\"deprecate\":false,\"editor\":false,\"group\":\"none\",\"max\":null,\"min\":0,\"name\":\"bucketAgg\",\"params\":[],\"title\":\"Bucket Agg\"},\"type\":\"date_histogram\"},\"customLabel\":\"per sec.\",\"customMetric\":{\"enabled\":true,\"id\":\"6-metric\",\"params\":{\"field\":\"SampleCount\",\"json\":\"{ \\\"script\\\" : \\\"_value/60\\\" }\"},\"schema\":{\"aggFilter\":[\"!top_hits\",\"!percentiles\",\"!percentile_ranks\",\"!median\",\"!std_dev\",\"!sum_bucket\",\"!avg_bucket\",\"!min_bucket\",\"!max_bucket\",\"!derivative\",\"!moving_avg\",\"!serial_diff\",\"!cumulative_sum\"],\"deprecate\":false,\"editor\":false,\"group\":\"none\",\"max\":null,\"min\":0,\"name\":\"metricAgg\",\"params\":[],\"title\":\"Metric Agg\"},\"type\":\"sum\"}},\"schema\":\"metric\",\"type\":\"avg_bucket\"},{\"enabled\":true,\"id\":\"3\",\"params\":{\"customLabel\":\"AVG resp.\",\"field\":\"ResponseTime\",\"json\":\"{ \\\"script\\\" : \\\"_value/1000\\\" }\"},\"schema\":\"metric\",\"type\":\"avg\"},{\"enabled\":true,\"id\":\"7\",\"params\":{\"customLabel\":\".\",\"field\":\"ResponseTime\",\"json\":\"{ \\\"script\\\" : \\\"_value/1000\\\" }\",\"percents\":[97]},\"schema\":\"metric\",\"type\":\"percentiles\"},{\"enabled\":true,\"id\":\"5\",\"params\":{\"customLabel\":\"Errors\",\"field\":\"ErrorCount\"},\"schema\":\"metric\",\"type\":\"sum\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"customLabel\":\"Transaction\",\"field\":\"SampleLabel.keyword\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"bucket\",\"type\":\"terms\"}],\"params\":{\"perPage\":null,\"showMeticsAtAllLevels\":false,\"showMetricsAtAllLevels\":false,\"showPartialRows\":false,\"showTotal\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"totalFunc\":\"count\"},\"title\":\"Aggregate report\",\"type\":\"table\"}",
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"ee1e1a40-eb63-11e8-892c-0191d6b4f25d\",\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[]}"
}
},
"_meta": {
"savedObjectVersion": 2
}
}
]
\ No newline at end of file
[
{
"id" : "jmeter-clickhouse-listener",
"name" : "Jmeter Clickhouse Listener",
"description" : "This JMeter Plugin allows to write load test data on-the-fly to ClickHouse\nAdditional feature: aggregation of Samplers\nExplanations and usage examples on project wiki.",
"screenshotUrl" : "https://gitlab.com/testload/jmeter-clickhouse-listener/wikis/uploads/498fd6f5a85d7ce62f5cad54f69f6ce7/Screenshot_at_May_08_14-21-40.png",
"helpUrl": "https://gitlab.com/testload/jmeter-clickhouse-listener/wikis/home",
"id" : "jmeter.pack-listener",
"name" : "Jmeter Listeners pack",
"description" : "This JMeter Plugin allows to write load test data on-the-fly to InfluxDB, ElasticSearch, ClickHouse\nAdditional feature: aggregation of Samplers\nExplanations and usage examples on project wiki.",
"screenshotUrl" : "https://gitlab.com/testload/jmeter-listener/wikis/uploads/498fd6f5a85d7ce62f5cad54f69f6ce7/Screenshot_at_May_08_14-21-40.png",
"helpUrl": "https://gitlab.com/testload/jmeter-listener/wikis/home",
"vendor": "cloud.testload",
"markerClass": "cloud.testload.jmeter.ClickHouseBackendListenerWriter",
"markerClass": "cloud.testload.jmeter.ClickHouseBackendListenerCLient",
"versions" : {
"2.0" : {
"downloadUrl" : "https://search.maven.org/remotecontent?filepath=cloud/testload/jmeter-clickhouse-listener/2.0/jmeter-clickhouse-listener-2.0.jar"
"1.5" : {
"downloadUrl" : "https://search.maven.org/remotecontent?filepath=cloud/testload/jmeter.pack-listener/1.5/jmeter.pack-listener-1.5.jar"
}
}
}
......
......@@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cloud.testload</groupId>
<artifactId>jmeter-clickhouse-listener</artifactId>
<version>2.02</version>
<artifactId>jmeter.pack-listener</artifactId>
<version>2.07</version>
<packaging>jar</packaging>
<name>JMeterClickhouseListener</name>
<description>JMeter Backend Listener is a JMeter plugin enabling you to send SampleResults to ClickHouse</description>
<url>https://gitlab.com/testload-group/jmeter-clickhouse-listener</url>
<name>JMeterPackListener</name>
<description>JMeter Backend Listener is a JMeter plugin enabling you to send SampleResults to ClickHouse, InfluxDB, ElasticSearch</description>
<url>https://gitlab.com/testload/jmeter-listener</url>
<licenses>
<license>
......@@ -21,7 +21,7 @@
</licenses>
<scm>
<url>https://gitlab.com/testload-group/jmeter-clickhouse-listener.git</url>
<url>https://gitlab.com/testload/jmeter-listener.git</url>
</scm>
<developers>
......@@ -32,13 +32,6 @@
<url>https://gitlab.com/testload</url>
<timezone>Europe/Moscow</timezone>
</developer>
<developer>
<id>ognivo777</id>
<name>Vladimir Taran</name>
<email></email>
<url>https://gitlab.com/ognivo777</url>
<timezone>Europe/Moscow</timezone>
</developer>
</developers>
<properties>
......@@ -48,6 +41,8 @@
<java.version>1.8</java.version>
<org.apache.jmeter.version>5.1</org.apache.jmeter.version>
<org.apache.commons>3.7</org.apache.commons>
<org.elasticsearch.client>6.4.0</org.elasticsearch.client>
<org.influxdb.influxdb-java>2.15</org.influxdb.influxdb-java>
<ru.yandex.clickhouse.clickhouse-jdbc>0.2.4</ru.yandex.clickhouse.clickhouse-jdbc>
</properties>
<dependencies>
......@@ -86,6 +81,16 @@
<version>${org.apache.commons}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>${org.elasticsearch.client}</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
<version>${org.influxdb.influxdb-java}</version>
</dependency>
<dependency>
<groupId>ru.yandex.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
......@@ -94,13 +99,11 @@
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>sonatype</id>
<name>Nexus Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype</id>
<name>Nexus Release Repository</name>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
......@@ -109,34 +112,32 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<!-- Сборка будет падать, если отсутствует GPG ключ -->
<!-- Подписываем артефакты только на фазе deploy -->
<phase>deploy</phase>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
......@@ -148,25 +149,24 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<!--<configuration>-->
<!--<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>-->
<!--</configuration>-->
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>generate-resources</phase>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<classesDirectory>${basedir}/javadoc</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
......@@ -188,11 +188,20 @@
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>2.4.1</version>
<executions>
<!-- Run shade goal on package phase -->
<execution>
......@@ -215,29 +224,5 @@
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>sonatype</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- Обновляем метаданные, чтобы пометить артефакт как release -->
<!-- Не влияет на snapshot версии -->
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Отключаем плагин -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
\ No newline at end of file
package cloud.testload.jmeter;
import java.sql.*;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import cloud.testload.jmeter.config.influxdb.TestStartEndMeasurement;
import main.java.cloud.testload.jmeter.config.clickhouse.ClickHouseConfig;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.threads.JMeterContextService;
import org.apache.jmeter.threads.JMeterContextService.ThreadCounts;
import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient;
import org.apache.jmeter.visualizers.backend.BackendListenerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import ru.yandex.clickhouse.ClickHouseArray;
import ru.yandex.clickhouse.ClickHouseDataSource;
import ru.yandex.clickhouse.settings.ClickHouseProperties;
import cloud.testload.jmeter.JMPoint;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* Backend listener that writes JMeter metrics to ClickHouse directly.
*
* @author Alexander Babaev (minor changes and improvements)
*
*/
public class ClickHouseBackendListenerClient extends AbstractBackendListenerClient implements Runnable {
/**
* Logger.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(ClickHouseBackendListenerClient.class);
/**
* Buffer.
*/
private static final List<SampleResult> allSampleResults = new ArrayList<SampleResult>();
/**
* Parameter Keys.
*/
private static final String KEY_USE_REGEX_FOR_SAMPLER_LIST = "useRegexForSamplerList";
private static final String KEY_PROFILE_NAME = "profileName";
private static final String KEY_RUN_ID = "runId";
private static final String KEY_SAMPLERS_LIST = "samplersList";
private static final String KEY_RECORD_SUB_SAMPLES = "recordSubSamples";
private static final String KEY_RECORD_GROUP_BY = "groupBy";
private static final String KEY_RECORD_GROUP_BY_COUNT = "groupByCountOrBatchSize";
private static final String KEY_RECORD_LEVEL = "recordAdditionalDataLevel";
/**
* Constants.
*/
private static final String SEPARATOR = ";";
private static final int ONE_MS_IN_NANOSECONDS = 1000000;
/**
* Scheduler for periodic metric aggregation.
*/
private ScheduledExecutorService scheduler;
/**
* Name of the test.
*/
private String profileName;
/**
* Name of the host(locahost or container etc)
*/
private String hostname;
/**
* A unique identifier for a single execution (aka 'run') of a load test.
* In a CI/CD automated performance test, a Jenkins or Bamboo build id would be a good value for this.
*/
private String runId;
/**
* List of samplers to record.
*/
private String samplersList = "";
/**
* Regex if samplers are defined through regular expression.
*/
private String regexForSamplerList;
/**
* Set of samplers to record.
*/
private Set<String> samplersToFilter;
/**
* ClickHouse configuration.
*/
ClickHouseConfig clickhouseConfig;
/**
* clickHouse DS.
*/
private ClickHouseDataSource clickHouse;
private Connection connection;
/**
* Random number generator
*/
private Random randomNumberGenerator;
/**
* Indicates whether to record Subsamples
*/
private boolean recordSubSamples;
/**
* Indicates whether to aggregate and level statistic
*/
private boolean groupBy;
private int groupByCount;
private String recordLevel;
/**
* Processes sampler results.
*/
public void handleSampleResults(List<SampleResult> sampleResults, BackendListenerContext context) {
// Gather only regex results to array
sampleResults.forEach(it -> {