-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (25 loc) · 994 Bytes
/
Program.cs
File metadata and controls
33 lines (25 loc) · 994 Bytes
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
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System;
using System.Reactive;
using System.Reactive.Linq;
using Tx.Windows;
namespace TxSamples.EtwRaw_VirtualTime
{
class Program
{
static void Main()
{
IObservable<EtwNativeEvent> etl = EtwObservable.FromFiles(@"HTTP_Server.etl");
var timeSource = new TimeSource<EtwNativeEvent>(etl, e => e.TimeStamp);
var countPerWindow = from window in timeSource.Window(TimeSpan.FromSeconds(5), timeSource.Scheduler)
from Count in window.Count()
select Count;
var withTime = countPerWindow.Timestamp(timeSource.Scheduler);
using (withTime.Subscribe(ts => Console.WriteLine("{0} {1}", ts.Timestamp, ts.Value)))
{
timeSource.Connect();
Console.ReadLine();
}
}
}
}