Änderungen Testperformance script

This commit is contained in:
ja
2021-12-22 14:34:01 +01:00
parent 1f4b9a7029
commit c6ea8cbf9b
6 changed files with 47 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
Imports Konscious.Security.Cryptography
Partial Class Customers_Default2
Inherits System.Web.UI.Page
Dim nIterations As Integer = VERAG_VARIABLES.getiterationnumber
Protected Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load
If Page.IsPostBack Then
@@ -35,6 +36,27 @@ Partial Class Customers_Default2
End Sub
Protected Sub btn_TesthashrateServer_ClickAsync(sender As Object, e As EventArgs) Handles btn_TesthashrateServer.Click
Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 2), Math.Pow(2, 5)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 7))))
Dim Boole As Boolean = New Boolean
Dim ram As Double = Double.Parse(My.Computer.Info.TotalPhysicalMemory.ToString)
Dim MemorySizelocal = ((nIterations * 4.98 - (nIterations * 1.23) / 4 * 1.5) / 1.05) + 1 * 290
Dim MemorySizeProductionServ = ((nIterations * 8.485 - (nIterations * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 416
If MemorySizelocal < ram And HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 0), Math.Pow(2, 3)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 6))))
Boole = True
ElseIf MemorySizeProductionServ < ram And Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 2), Math.Pow(2, 4)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 7))))
Boole = True
Else
Boole = False
End If
If Boole = True Then
lbl_Status.Text = "Der Test wurde erfolgreich bestanden!"
ElseIf Boole = False AndAlso HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
lbl_Status.Text = "Test fehlgeschlagen! Es fehlen mindestens " + MemorySizelocal - ram + "Bytes RAM!"
ElseIf Boole = False AndAlso Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
lbl_Status.Text = "Test fehlgeschlagen! Es fehlen mindestens " + MemorySizeProductionServ - ram + "Bytes RAM!"
End If
End Sub
End Class