EDMIService/Scheduler: Log timings and memory usage for jobs
This commit is contained in:
@@ -20,6 +20,7 @@ Public Class DatatableJob
|
||||
Dim oCronJobTitle As String = oJobData.Item("CronJobTitle")
|
||||
Dim oLogger As Logger = oLogConfig.GetLogger()
|
||||
|
||||
Dim oStopWatch As New Stopwatch()
|
||||
Dim oResult As New JobResult()
|
||||
|
||||
oLogger.Info("Running Datatable Job [{0}]/[{1}]", context.JobDetail.Key, oCronJobTitle)
|
||||
@@ -43,12 +44,18 @@ Public Class DatatableJob
|
||||
oLogger.Debug("Datatable Name: {0}", oDatatableName)
|
||||
oLogger.Debug("Connection Id: {0}", oConnectionId)
|
||||
|
||||
oStopWatch.Start()
|
||||
|
||||
Dim oConnectionString = oMSSQL.Get_ConnectionStringforID(oConnectionId)
|
||||
Dim oDecryptedConnectionString = MSSQLServer.DecryptConnectionString(oConnectionString)
|
||||
|
||||
Dim oTable = oMSSQL.GetDatatableWithConnection(oSQL, oDecryptedConnectionString, COMMAND_SQL_TIMEOUT)
|
||||
oTable.TableName = oDatatableName
|
||||
|
||||
oStopWatch.Stop()
|
||||
oLogger.Debug("[Time] Getting Data From DB: {0}ms", oStopWatch.ElapsedMilliseconds)
|
||||
oStopWatch.Restart()
|
||||
|
||||
Dim oView As DataView = Nothing
|
||||
|
||||
' This creates an Index for the columns specified in INDEX_COLUMNS to speed up calls to 'Table.Select'!
|
||||
@@ -59,6 +66,10 @@ Public Class DatatableJob
|
||||
}
|
||||
End If
|
||||
|
||||
oStopWatch.Stop()
|
||||
oLogger.Debug("[Time] Creating Indexes: {0}ms", oStopWatch.ElapsedMilliseconds)
|
||||
oStopWatch.Restart()
|
||||
|
||||
oLogger.Debug("Result Datatable [{0}] contains [{1}] rows", oTable.TableName, oTable.Rows.Count)
|
||||
|
||||
Dim oResultTable = New JobResult.ResultTable() With {
|
||||
@@ -81,6 +92,9 @@ Public Class DatatableJob
|
||||
oResultTable.TableRelationColumn = oParentColumn
|
||||
End If
|
||||
|
||||
oStopWatch.Stop()
|
||||
oLogger.Debug("[Time] Adding Relations: {0}ms", oStopWatch.ElapsedMilliseconds)
|
||||
|
||||
oLogger.Info("Fetched Datatable [{0}]", oDatatableName)
|
||||
oResult.Tables.Add(oResultTable)
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user