This repository was archived by the owner on Jul 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWcfTab.cs
More file actions
49 lines (40 loc) · 1.5 KB
/
WcfTab.cs
File metadata and controls
49 lines (40 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Extensions;
namespace Glimpse.Wcf
{
public class WcfTab : ITab, ITabSetup
{
public static volatile int MaxDetailedLogs = 1000;
public string Name { get { return "WCF"; } }
public RuntimeEvent ExecuteOn { get { return RuntimeEvent.EndRequest; } }
public Type RequestContextType { get { return null; } }
public object GetData(ITabContext context)
{
var logEntries = context.GetMessages<WcfEntry>();
if (logEntries == null)
return null;
// Evaluate any expression trees
logEntries = logEntries.ToArray();
var data = new List<object[]> {new object[] {"Timestamp", "Elapsed", "Action", "Request", "Response"}};
data.AddRange(logEntries.Select(log => new object[] {
log.StartTime,
log.Duration.Milliseconds,
log.EventName,
log.RequestBody,
log.ResponseBody
}));
return data;
}
public void Setup(ITabSetupContext context)
{
context.PersistMessages<WcfEntry>();
}
public string DocumentationUri
{
get { return "http://github.com/stweb/glimpse.wcf"; }
}
}
}