Benchmark: Update to latest EDMIService

This commit is contained in:
Jonathan Jenne
2021-12-01 13:22:22 +01:00
parent df2b59b471
commit cee7ccda41
3 changed files with 82 additions and 85 deletions

View File

@@ -61,8 +61,9 @@ Public Class Form1
AddLogMessage($"Importing {oFileInfo.Name}... ({FormatBytes(oFileInfo.Length)})")
'Dim oObjectId As Long = Await _Client.ImportFileAsync(oFileInfo.FullName, "WichtigesDokument", 1, 0)
'AddLogMessage($"File with Id [{oObjectId}] imported!")
Dim oObjectId As Long = Await _Client.NewFileAsync(oFileInfo.FullName, "Work", "DOC", "DEFAULT",
New Client.NewFileOptions With {.Username = Environment.UserName})
AddLogMessage($"File with Id [{oObjectId}] imported!")
oCountFiles += 1
oSW.Stop()
AddLogMessage($"Import Time: {FormatTime(oSW.ElapsedMilliseconds)}")
@@ -145,81 +146,79 @@ Public Class Form1
End Try
End Sub
Private Async Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
Try
Dim oResult As Client.FileList = Await _Client.ListFilesForUserAsync()
Dim oParams As New DocumentResultParams() With {
.Results = New List(Of DocumentResult) From {
New DocumentResult() With {.Title = "lol", .Datatable = oResult.Datatable}
},
.WindowGuid = "1",
.ColumnNames = New ColumnNames() With {
.FilenameColumn = "FILENAME_EXT",
.FullPathColumn = "FULL_PATH",
.ObjectIdColumn = "IDB_OBJ_ID"
}
}
Dim oEnv As New DigitalData.Modules.ZooFlow.Environment() With {
.Service = New ServiceState() With {
.IsActive = True,
.Address = "172.24.12.39:9000"
},
.Settings = New SettingsState With {
.GdPictureKey = "21182889975216572111813147150675976632"
},
.User = New UserState() With {
.UserId = 2
}
}
Dim oForm As New frmDocumentResultList(_LogConfig, oEnv, oParams)
oForm.Show()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
End Try
End Sub
'Private Async Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
' Try
' Dim oResult As Client.FileList = Await _Client.ListFilesForUserAsync()
' Dim oParams As New DocumentResultParams() With {
' .Results = New List(Of DocumentResult) From {
' New DocumentResult() With {.Title = "lol", .Datatable = oResult.Datatable}
' },
' .WindowGuid = "1",
' .ColumnNames = New ColumnNames() With {
' .FilenameColumn = "FILENAME_EXT",
' .FullPathColumn = "FULL_PATH",
' .ObjectIdColumn = "IDB_OBJ_ID"
' }
' }
' Dim oEnv As New DigitalData.Modules.ZooFlow.Environment() With {
' .Service = New ServiceState() With {
' .IsActive = True,
' .Address = "172.24.12.39:9000"
' },
' .Settings = New SettingsState With {
' .GdPictureKey = "21182889975216572111813147150675976632"
' },
' .User = New UserState(2)
' }
' Dim oForm As New frmDocumentResultList(_LogConfig, oEnv, oParams)
' oForm.Show()
' Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
' End Try
'End Sub
Private Async Sub BindingSource1_CurrentChanged(sender As Object, e As EventArgs) Handles BindingSource1.CurrentChanged
Dim oRow As DataRow = GridView1.GetFocusedDataRow()
'Private Async Sub BindingSource1_CurrentChanged(sender As Object, e As EventArgs) Handles BindingSource1.CurrentChanged
' Dim oRow As DataRow = GridView1.GetFocusedDataRow()
If oRow Is Nothing Then
Exit Sub
End If
' If oRow Is Nothing Then
' Exit Sub
' End If
Try
Dim oSWTotal As New Stopwatch()
oSWTotal.Start()
' Try
' Dim oSWTotal As New Stopwatch()
' oSWTotal.Start()
Dim oObjectId As Long = oRow.Item("IDB_OBJ_ID")
Dim oResponse As Client.StreamedFile = Await _Client.GetFileByObjectIdAsync(oObjectId)
' Dim oObjectId As Long = oRow.Item("IDB_OBJ_ID")
' Dim oResponse As Client.StreamedFile = Await _Client.GetFileByObjectIdAsync(oObjectId)
DocumentViewer1.LoadFile(oResponse.FileName, oResponse.Stream)
' DocumentViewer1.LoadFile(oResponse.FileName, oResponse.Stream)
oSWTotal.Stop()
AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]")
Catch ex As FaultException
MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
End Try
End Sub
' oSWTotal.Stop()
' AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]")
' Catch ex As FaultException
' MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service")
' Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
' End Try
'End Sub
Private Async Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Try
Dim oSWTotal As New Stopwatch()
oSWTotal.Start()
'Private Async Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
' Try
' Dim oSWTotal As New Stopwatch()
' oSWTotal.Start()
Dim oObjectId As Integer = TextboxObjectId.EditValue
' Dim oObjectId As Integer = TextboxObjectId.EditValue
Dim oResponse As Client.StreamedFile = Await _Client.GetFileByObjectIdAsync(oObjectId)
' Dim oResponse As Client.StreamedFile = Await _Client.GetFileByObjectIdAsync(oObjectId)
DocumentViewer1.LoadFile(oResponse.FileName, oResponse.Stream)
' DocumentViewer1.LoadFile(oResponse.FileName, oResponse.Stream)
oSWTotal.Stop()
AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]")
Catch ex As Exception
AddLogMessage($"Error while getting file: [{ex.Message}]")
End Try
End Sub
' oSWTotal.Stop()
' AddLogMessage($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]")
' Catch ex As Exception
' AddLogMessage($"Error while getting file: [{ex.Message}]")
' End Try
'End Sub
Private Sub BarToggleSwitchItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarToggleSwitchItem1.CheckedChanged
If BarToggleSwitchItem1.Checked Then