Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Gem/Code/Source/NetSoakTestSystemComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ namespace NetSoakTest
AZ_CVAR(uint16_t, soak_port, 33450, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The port that this soak test will bind to for game traffic");
AZ_CVAR(ProtocolType, soak_protocol, ProtocolType::Udp, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Soak test protocol");
AZ_CVAR(SoakMode, soak_mode, SoakMode::Loopback, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Soak test mode");
AZ_CVAR(AZ::TimeMs, soak_runtime, AZ::TimeMs(0), nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "How long to run the soak test for before dumping stats");

void NetSoakTestSystemComponent::Reflect(AZ::ReflectContext* context)
{
Expand Down Expand Up @@ -173,7 +174,16 @@ namespace NetSoakTest

void NetSoakTestSystemComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
{
[[maybe_unused]] AZ::TimeMs elapsedMs = aznumeric_cast<AZ::TimeMs>(aznumeric_cast<int64_t>(deltaTime / 1000.0f));
AZ::TimeMs elapsedMs = aznumeric_cast<AZ::TimeMs>(aznumeric_cast<int64_t>(deltaTime / 1000.0f));

m_totalElapsedMs += elapsedMs;
if (soak_runtime != AZ::TimeMs(0) && m_totalElapsedMs > soak_runtime)
{
const AZ::CVarFixedString dumpSoakStatsStrings = "DumpSoakStats";
const auto console = AZ::Interface<AZ::IConsole>::Get();
console->PerformCommand(dumpSoakStatsStrings.c_str());
exit(0);
}

NetSoakTestPackets::Small packet;

Expand Down
2 changes: 2 additions & 0 deletions Gem/Code/Source/NetSoakTestSystemComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,7 @@ namespace NetSoakTest
private:
AzNetworking::INetworkInterface* m_networkInterface = nullptr;
AzNetworking::INetworkInterface* m_loopbackInterface = nullptr;

AZ::TimeMs m_totalElapsedMs = AZ::TimeMs(0);
};
}
9 changes: 9 additions & 0 deletions Scripts/build/Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,15 @@ def Build(Map pipelineConfig, String platform, String type, String workspace) {
command += " -u ${pipelineConfig.BUILD_ENTRY_POINT} --platform ${platform} --type ${type}"
dir("${workspace}/${ENGINE_REPOSITORY_NAME}") {
PlatformSh(command, "Running ${platform} ${type}")

// Only launch NetSoakTest on the appropriate platforms
if (platform == 'Windows' && type != 'validation') {
// Launch the project, which automatically starts the tests
launch_command = "NetSoakTest.ServerLauncher.exe --soak_runtime=1800000 --soak_mode=loopback --rhi=null"
dir("${workspace}/${ENGINE_REPOSITORY_NAME}") {
PlatformSh("build/windows/bin/${type}/${launch_command}", "Running NetSoakTest project")
}
}
}
}
}
Expand Down