Skip to content

Commit

Permalink
version 1.1 change Fail Message when equality
Browse files Browse the repository at this point in the history
  • Loading branch information
DABURON Vincent committed May 16, 2023
1 parent 3861ee6 commit 7f22c68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The maven groupId, artifactId and version, this plugin is in the **Maven Central
```xml
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
<version>1.0</version>
<version>1.1</version>
```
Just include the plugin in your `pom.xml` and execute `mvn verify` <br>
or individual launch `mvn -DjsonStats=statistics.json -DkpiFile=kpi.csv -DjunitFile=jmeter-junit-plugin-jmstats.xml exec:java@create_junit-report-kpi-from-jmeter-json-statics`
Expand All @@ -117,7 +117,7 @@ or individual launch `mvn -DjsonStats=statistics.json -DkpiFile=kpi.csv -DjunitF
<dependency>
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -167,5 +167,7 @@ Usually this plugin is use with [jmeter-maven-plugin](https://github.com/jmeter-
You could also use [jmeter-graph-tool-maven-plugin](https://github.com/vdaburon/jmeter-graph-tool-maven-plugin)

## Versions
Version 1.1 change Fail Message when equality

Version 1.0 initial version

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
<version>1.0</version>
<version>1.1</version>
<packaging>jar</packaging>
<name>Create a JUnit XML file with KPI rules from JMeter Dashboard Stats</name>
<description>A tool that creates a JUnit XML file with KPI rules from JMeter JMeter Dashboard stats.json</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ private static boolean analyseJsonJMReportWithKpiRules(String jsonJmeterStats, S

Document document = UtilsJUnitXml.createJUnitRootDocument();
for (int i = 0; i < csvKpiLines.size(); i++) {
CSVRecord recordKpiLine = csvKpiLines.get(i);
if (recordKpiLine.size() < 3) {
continue;
}
CheckKpiResult checkKpiResult = verifyKpi(csvKpiLines.get(i), listStats);
if (checkKpiResult.isKpiFail()) {
isFail = true;
Expand Down Expand Up @@ -218,7 +222,7 @@ private static CheckKpiResult verifyKpi(CSVRecord recordKpiLine, List<Statistic>
isFailKpi = true;
if (isFirstFail) {
isFirstFail = false;
String failMessage = "Actual value " + dMetric + " exceeds threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\""; // Actual value 2908,480000 exceeds threshold 2500,000000 for samples matching "@SC01_P03_DUMMY"
String failMessage = "Actual value " + dMetric + " exceeds or equals threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\""; // Actual value 2908,480000 exceeds threshold 2500,000000 for samples matching "@SC01_P03_DUMMY"
checkKpiResult.setKpiFail(true);
checkKpiResult.setFailMessage(failMessage);
} else {
Expand All @@ -241,7 +245,7 @@ private static CheckKpiResult verifyKpi(CSVRecord recordKpiLine, List<Statistic>
isFailKpi = true;
if (isFirstFail) {
isFirstFail = false;
String failMessage = "Actual value " + dMetric + " exceeds or equals threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
String failMessage = "Actual value " + dMetric + " exceeds threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
checkKpiResult.setKpiFail(true);
checkKpiResult.setFailMessage(failMessage);
} else {
Expand All @@ -264,7 +268,7 @@ private static CheckKpiResult verifyKpi(CSVRecord recordKpiLine, List<Statistic>
isFailKpi = true;
if (isFirstFail) {
isFirstFail = false;
String failMessage = "Actual value " + dMetric + " is less then threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
String failMessage = "Actual value " + dMetric + " is less or equals then threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
checkKpiResult.setKpiFail(true);
checkKpiResult.setFailMessage(failMessage);
} else {
Expand All @@ -287,7 +291,7 @@ private static CheckKpiResult verifyKpi(CSVRecord recordKpiLine, List<Statistic>
isFailKpi = true;
if (isFirstFail) {
isFirstFail = false;
String failMessage = "Actual value " + dMetric + "is less or equals threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
String failMessage = "Actual value " + dMetric + " is less threshold " + dThreshold + " for samples matching \"" + labelRegex + "\"; fail label(s) \"" + label + "\"";
checkKpiResult.setKpiFail(true);
checkKpiResult.setFailMessage(failMessage);
} else {
Expand Down

0 comments on commit 7f22c68

Please sign in to comment.