Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBlagov committed Feb 21, 2019
2 parents 4f6549a + caea2ae commit 7424e22
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 92 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu May 11 19:05:37 NOVT 2017
#Fri Feb 01 15:27:25 NOVT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
180 changes: 90 additions & 90 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public ChartContainerController(String selectedType, IntegerProperty interval) {
createContextMenuItem(ChartsFactory.ChartTypes.TX_BPS_L1),
createContextMenuItem(ChartsFactory.ChartTypes.TX_BPS_L2),
createContextMenuItem(ChartsFactory.ChartTypes.RX_BPS_L2),
createContextMenuItem(ChartsFactory.ChartTypes.PACKET_LOSS),
new SeparatorMenuItem(),
createContextMenuItem(ChartsFactory.ChartTypes.MAX_LATENCY, runningConfiguration.latencyEnabledProperty()),
createContextMenuItem(ChartsFactory.ChartTypes.AVG_LATENCY, runningConfiguration.latencyEnabledProperty()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static class ChartTypes {
public static final String JITTER_LATENCY = "Jitter Latency";
public static final String TEMPORARY_MAX_LATENCY = "Temporary Max Latency";
public static final String LATENCY_HISTOGRAM = "Latency Histogram";
public static final String PACKET_LOSS = "Packet loss";
}

public static FlowChartController create(String chartType, IntegerProperty interval) {
Expand All @@ -25,6 +26,8 @@ public static FlowChartController create(String chartType, IntegerProperty inter
return new RxPpsController(interval);
case ChartTypes.TX_BPS_L1:
return new TxBpsL1Controller(interval);
case ChartTypes.PACKET_LOSS:
return new PacketLossController(interval);
case ChartTypes.TX_BPS_L2:
return new TxBpsL2Controller(interval);
case ChartTypes.RX_BPS_L2:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.cisco.trex.stl.gui.controllers.dashboard.charts;

import com.cisco.trex.stl.gui.models.FlowStatPoint;
import javafx.beans.property.IntegerProperty;


public class PacketLossController extends StreamLineChartController {
public PacketLossController(final IntegerProperty interval) {
super(interval);
}

protected String getYChartName() {
return "Packet loss";
}

protected String getYChartUnits() {
return "p/s";
}

protected Number getValue(final FlowStatPoint point) {
return point.getPacketLossPerSecond();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void onWindowCloseRequest(final WindowEvent window) {

@Override
protected void render() {
int firstColumnWidth = 120;
int firstColumnWidth = 190;
int secondHeaderWidth = 150;

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

int rowIndex = 1;

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

rowIndex++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class FlowStatPoint {
private double tbsL1;
private double tbsL2;
private long tp;
private double packetLossPerSecond;
private double tps;
private double time;

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

Expand Down Expand Up @@ -72,4 +74,8 @@ public double getTps() {
public double getTime() {
return time;
}

public double getPacketLossPerSecond() {
return packetLossPerSecond;
}
}

0 comments on commit 7424e22

Please sign in to comment.