Skip to content

Commit 7424e22

Browse files
committed
2 parents 4f6549a + caea2ae commit 7424e22

File tree

7 files changed

+129
-92
lines changed

7 files changed

+129
-92
lines changed

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Thu May 11 19:05:37 NOVT 2017
1+
#Fri Feb 01 15:27:25 NOVT 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME

gradlew.bat

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
@if "%DEBUG%" == "" @echo off
2-
@rem ##########################################################################
3-
@rem
4-
@rem Gradle startup script for Windows
5-
@rem
6-
@rem ##########################################################################
7-
8-
@rem Set local scope for the variables with windows NT shell
9-
if "%OS%"=="Windows_NT" setlocal
10-
11-
set DIRNAME=%~dp0
12-
if "%DIRNAME%" == "" set DIRNAME=.
13-
set APP_BASE_NAME=%~n0
14-
set APP_HOME=%DIRNAME%
15-
16-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
18-
19-
@rem Find java.exe
20-
if defined JAVA_HOME goto findJavaFromJavaHome
21-
22-
set JAVA_EXE=java.exe
23-
%JAVA_EXE% -version >NUL 2>&1
24-
if "%ERRORLEVEL%" == "0" goto init
25-
26-
echo.
27-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28-
echo.
29-
echo Please set the JAVA_HOME variable in your environment to match the
30-
echo location of your Java installation.
31-
32-
goto fail
33-
34-
:findJavaFromJavaHome
35-
set JAVA_HOME=%JAVA_HOME:"=%
36-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37-
38-
if exist "%JAVA_EXE%" goto init
39-
40-
echo.
41-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42-
echo.
43-
echo Please set the JAVA_HOME variable in your environment to match the
44-
echo location of your Java installation.
45-
46-
goto fail
47-
48-
:init
49-
@rem Get command-line arguments, handling Windows variants
50-
51-
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
53-
54-
:win9xME_args
55-
@rem Slurp the command line arguments.
56-
set CMD_LINE_ARGS=
57-
set _SKIP=2
58-
59-
:win9xME_args_slurp
60-
if "x%~1" == "x" goto execute
61-
62-
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
68-
69-
:execute
70-
@rem Setup the command line
71-
72-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73-
74-
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76-
77-
:end
78-
@rem End local scope for the variables with windows NT shell
79-
if "%ERRORLEVEL%"=="0" goto mainEnd
80-
81-
:fail
82-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83-
rem the _cmd.exe /c_ return code!
84-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85-
exit /b 1
86-
87-
:mainEnd
88-
if "%OS%"=="Windows_NT" endlocal
89-
90-
:omega
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
if "%@eval[2+2]" == "4" goto 4NT_args
53+
54+
:win9xME_args
55+
@rem Slurp the command line arguments.
56+
set CMD_LINE_ARGS=
57+
set _SKIP=2
58+
59+
:win9xME_args_slurp
60+
if "x%~1" == "x" goto execute
61+
62+
set CMD_LINE_ARGS=%*
63+
goto execute
64+
65+
:4NT_args
66+
@rem Get arguments from the 4NT Shell from JP Software
67+
set CMD_LINE_ARGS=%$
68+
69+
:execute
70+
@rem Setup the command line
71+
72+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
74+
@rem Execute Gradle
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76+
77+
:end
78+
@rem End local scope for the variables with windows NT shell
79+
if "%ERRORLEVEL%"=="0" goto mainEnd
80+
81+
:fail
82+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83+
rem the _cmd.exe /c_ return code!
84+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85+
exit /b 1
86+
87+
:mainEnd
88+
if "%OS%"=="Windows_NT" endlocal
89+
90+
:omega

src/main/java/com/cisco/trex/stl/gui/controllers/dashboard/charts/ChartContainerController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public ChartContainerController(String selectedType, IntegerProperty interval) {
5050
createContextMenuItem(ChartsFactory.ChartTypes.TX_BPS_L1),
5151
createContextMenuItem(ChartsFactory.ChartTypes.TX_BPS_L2),
5252
createContextMenuItem(ChartsFactory.ChartTypes.RX_BPS_L2),
53+
createContextMenuItem(ChartsFactory.ChartTypes.PACKET_LOSS),
5354
new SeparatorMenuItem(),
5455
createContextMenuItem(ChartsFactory.ChartTypes.MAX_LATENCY, runningConfiguration.latencyEnabledProperty()),
5556
createContextMenuItem(ChartsFactory.ChartTypes.AVG_LATENCY, runningConfiguration.latencyEnabledProperty()),

src/main/java/com/cisco/trex/stl/gui/controllers/dashboard/charts/ChartsFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public static class ChartTypes {
1515
public static final String JITTER_LATENCY = "Jitter Latency";
1616
public static final String TEMPORARY_MAX_LATENCY = "Temporary Max Latency";
1717
public static final String LATENCY_HISTOGRAM = "Latency Histogram";
18+
public static final String PACKET_LOSS = "Packet loss";
1819
}
1920

2021
public static FlowChartController create(String chartType, IntegerProperty interval) {
@@ -25,6 +26,8 @@ public static FlowChartController create(String chartType, IntegerProperty inter
2526
return new RxPpsController(interval);
2627
case ChartTypes.TX_BPS_L1:
2728
return new TxBpsL1Controller(interval);
29+
case ChartTypes.PACKET_LOSS:
30+
return new PacketLossController(interval);
2831
case ChartTypes.TX_BPS_L2:
2932
return new TxBpsL2Controller(interval);
3033
case ChartTypes.RX_BPS_L2:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.cisco.trex.stl.gui.controllers.dashboard.charts;
2+
3+
import com.cisco.trex.stl.gui.models.FlowStatPoint;
4+
import javafx.beans.property.IntegerProperty;
5+
6+
7+
public class PacketLossController extends StreamLineChartController {
8+
public PacketLossController(final IntegerProperty interval) {
9+
super(interval);
10+
}
11+
12+
protected String getYChartName() {
13+
return "Packet loss";
14+
}
15+
16+
protected String getYChartUnits() {
17+
return "p/s";
18+
}
19+
20+
protected Number getValue(final FlowStatPoint point) {
21+
return point.getPacketLossPerSecond();
22+
}
23+
}

src/main/java/com/cisco/trex/stl/gui/controllers/dashboard/streams/StreamsController.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void onWindowCloseRequest(final WindowEvent window) {
4949

5050
@Override
5151
protected void render() {
52-
int firstColumnWidth = 120;
52+
int firstColumnWidth = 190;
5353
int secondHeaderWidth = 150;
5454

5555
table.getChildren().clear();
@@ -69,6 +69,8 @@ protected void render() {
6969
table.add(new StatisticLabelCell("ipackets", firstColumnWidth, true, CellType.DEFAULT_CELL, false), 0, 12);
7070
table.add(new StatisticLabelCell("obytes", firstColumnWidth, false, CellType.DEFAULT_CELL, false), 0, 13);
7171
table.add(new StatisticLabelCell("ibytes", firstColumnWidth, true, CellType.DEFAULT_CELL, false), 0, 14);
72+
table.add(new StatisticLabelCell("packet loss (total)", firstColumnWidth, false, CellType.DEFAULT_CELL, false), 0, 15);
73+
table.add(new StatisticLabelCell("packet loss (per second)", firstColumnWidth, true, CellType.DEFAULT_CELL, false), 0, 16);
7274

7375
int rowIndex = 1;
7476

@@ -119,6 +121,8 @@ protected void render() {
119121
table.add(new StatisticLabelCell(String.valueOf(rp), secondHeaderWidth, true, CellType.DEFAULT_CELL, true, isStopped), rowIndex, 12);
120122
table.add(new StatisticLabelCell(String.valueOf(tb), secondHeaderWidth, false, CellType.DEFAULT_CELL, true, isStopped), rowIndex, 13);
121123
table.add(new StatisticLabelCell(String.valueOf(rb), secondHeaderWidth, true, CellType.DEFAULT_CELL, true, isStopped), rowIndex, 14);
124+
table.add(new StatisticLabelCell(String.valueOf(tp - rp), secondHeaderWidth, false, CellType.DEFAULT_CELL, true, isStopped), rowIndex, 15);
125+
table.add(new StatisticLabelCell(Util.getFormatted(String.valueOf(round(flowStatPoint.getPacketLossPerSecond())), true, "pkt/s"), secondHeaderWidth, true, CellType.DEFAULT_CELL, true, isStopped), rowIndex, 16);
122126

123127
rowIndex++;
124128
}

src/main/java/com/cisco/trex/stl/gui/models/FlowStatPoint.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class FlowStatPoint {
1313
private double tbsL1;
1414
private double tbsL2;
1515
private long tp;
16+
private double packetLossPerSecond;
1617
private double tps;
1718
private double time;
1819

@@ -27,6 +28,7 @@ public FlowStatPoint(final FlowStat flowStat, final double time) {
2728
tps = flowStat.getTps().values().stream().mapToDouble(Double::doubleValue).sum();
2829
tbsL1 = tbsL2 + 20 * tps * 8;
2930
rbsL1 = rbsL2 + 20 * rps * 8;
31+
packetLossPerSecond = tps - rps;
3032
this.time = time;
3133
}
3234

@@ -72,4 +74,8 @@ public double getTps() {
7274
public double getTime() {
7375
return time;
7476
}
77+
78+
public double getPacketLossPerSecond() {
79+
return packetLossPerSecond;
80+
}
7581
}

0 commit comments

Comments
 (0)