Task history takes too long to load on remote server for small number of logs
See original GitHub issueTaskEventLog takes really long time to load logs for a particular task even for small number of logs.
I am using TaskEventLog constructor to connect to a remote server to read logs/history of a task. The code takes really long time to finish even for a small number of logs (30-60 entries). I am not getting any run time exceptions so I think that the creation of TaskEvent object is taking long. Please find below the code and other details.
- Library Version - 2.8.16
- Remote Server - Windows Server 2016 , 64-bit, x64 based processor
Any help/suggestions to resolve this issue is greatly appreciated.
TaskEventLog log = new TaskEventLog(@"\Test Task",
// Specify the event id(s) you want to enumerate
new int[] {
200 /* ActionStart */,
201 /* ActionSuccess */ ,
202 /* ActionFailure */
},
// Specify the start date of the events to enumerate. Here, we look at the last week.
DateTime.Now.AddDays(-7), "Server", "Domain", "Username", "Password");
// Tell the enumerator to expose events 'newest first'
log.EnumerateInReverse = false;
//The below code takes long time to finish (more than 5 minutes for 50 odd logs)
var history = log.Select(ev => new History
{
Level = ev.Level,
Created = ev.TimeCreated,
EventId = ev.EventId,
TaskCategory = ev.TaskCategory,
OperationalCode = ev.OpCode,
CorrelationId = ev.ActivityId
})
.ToList();
//Custom class for displaying History on the UI
public class History
{
public string Level { get; set; }
public DateTime? Created { get; set; }
public int EventId { get; set; }
public string TaskCategory { get; set; }
public string OperationalCode { get; set; }
public Guid? CorrelationId { get; set; }
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why does it take so long to view logs on a server?
Yes, reading logs takes a long time in the log file viewer. A few things to fix it: Try using xp_readerrorlog with filtered...
Read more >High CPU usage troubleshooting guidance
Task Manager. Use Task Manager to view CPU consumption to help identify the process or application that's causing high CPU usage:.
Read more >windows 7 - How to see scheduled task logs?
Just pause long enough for the task to finish. Another thing I do is to put the average run time in the description...
Read more >Read history of a task on a remote server
Nope, the \taskname is just fine, in fact it's required (it's the path). You're having the same issue I was having until I...
Read more >SQL Server Transaction Log Growth Monitoring and ...
In the transactional systems with excessive logging operations, the SQL Server Transaction Log file will grow rapidly, until it reaches its ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately I could not find any solution to fix the performance issue, however, there was a significant performance improvement after the application was deployed to server. I was facing this issue on my workstation.
I have the same issue. Please could you tell me whether you have found the reason of your performance problems?