G
Guest
I have a timer running on our form and what we have seen is users who leave
there application open for more than a day straight will have a response
problem with the UI. We tracked the CPU utilization and the spikes started
off at 1 min intervals every 10 minutes and it increased to 10 minutes
intervals after 3 days having the app open. I'm wording if it's the Timer
that is causing these spikes espically seeing that the user wasn't doing
anything to the app most of the time. See my code below and please let me
know if anyone sees a problem that could be causing the cpu spikes and the
distruption for the users.
Me.QueueTimer.Enabled = True
Me.QueueTimer.Interval = 600000
Me.QueueTimer.SynchronizingObject = Me
******************************************
Private Sub TraderPortal_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
subSetupTimer()
Catch exp As Exception
MessageBox.Show(exp.Message.ToString)
End Try
End Sub
Public Sub subSetupTimer()
Try
'Setup the event handler for the timer when it fires
AddHandler QueueTimer.Elapsed, AddressOf TimerFiredForQueue
Catch exp As Exception
ExceptionCall.ExceptionHandling.LogError(exp.Message.ToString)
End Try
End Sub
Public Sub TimerFiredForQueue(ByVal sender As Object, _
ByVal e As System.Timers.ElapsedEventArgs)
Try
QueueTimer.Enabled = False
'Now we need to refresh the intra day view
QueueFlex.Clear(C1.Win.C1FlexGrid.ClearFlags.UserData)
dsNotifications.Clear()
QueueFlex.Redraw = False
Dim parm As New SqlClient.SqlParameter("@BLTID",
Main.oProperties.UsersBankLoanTeamID)
DBCalls.AccessDataLayer.FillGridWithDataset("SelUserNotifications",
Main.oProperties.ConnectionString, dsNotifications, "queue", QueueFlex, parm)
QueueFlex.Redraw = True
FillSplitCalendarItemslocal()
If isFilter Then
btnApplyFilter_Click(sender, e)
Else
ResetCalendar()
End If
QueueTimer.Enabled = True
Catch exp As Exception
MessageBox.Show(exp.Message.ToString)
End Try
End Sub
Was this post helpful to you?
there application open for more than a day straight will have a response
problem with the UI. We tracked the CPU utilization and the spikes started
off at 1 min intervals every 10 minutes and it increased to 10 minutes
intervals after 3 days having the app open. I'm wording if it's the Timer
that is causing these spikes espically seeing that the user wasn't doing
anything to the app most of the time. See my code below and please let me
know if anyone sees a problem that could be causing the cpu spikes and the
distruption for the users.
Me.QueueTimer.Enabled = True
Me.QueueTimer.Interval = 600000
Me.QueueTimer.SynchronizingObject = Me
******************************************
Private Sub TraderPortal_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
subSetupTimer()
Catch exp As Exception
MessageBox.Show(exp.Message.ToString)
End Try
End Sub
Public Sub subSetupTimer()
Try
'Setup the event handler for the timer when it fires
AddHandler QueueTimer.Elapsed, AddressOf TimerFiredForQueue
Catch exp As Exception
ExceptionCall.ExceptionHandling.LogError(exp.Message.ToString)
End Try
End Sub
Public Sub TimerFiredForQueue(ByVal sender As Object, _
ByVal e As System.Timers.ElapsedEventArgs)
Try
QueueTimer.Enabled = False
'Now we need to refresh the intra day view
QueueFlex.Clear(C1.Win.C1FlexGrid.ClearFlags.UserData)
dsNotifications.Clear()
QueueFlex.Redraw = False
Dim parm As New SqlClient.SqlParameter("@BLTID",
Main.oProperties.UsersBankLoanTeamID)
DBCalls.AccessDataLayer.FillGridWithDataset("SelUserNotifications",
Main.oProperties.ConnectionString, dsNotifications, "queue", QueueFlex, parm)
QueueFlex.Redraw = True
FillSplitCalendarItemslocal()
If isFilter Then
btnApplyFilter_Click(sender, e)
Else
ResetCalendar()
End If
QueueTimer.Enabled = True
Catch exp As Exception
MessageBox.Show(exp.Message.ToString)
End Try
End Sub
Was this post helpful to you?