microsoft/Tx

PerformanceSample.Timestamp is always the same when using PerfCounterObservable.FromFile

felipepessoto opened this issue · 5 comments

I opened a BLG file and read to the end. Every Timestamp have the same value, the same as the first sample.

Repro:

        var perfs = PerfCounterObservable.FromFile("MyPcPerfMon.blg");


            perfs.Subscribe(x =>
            {
                Console.WriteLine($"{x.Timestamp} - {x.CounterSet}/{x.CounterName}/{x.Instance}: Value: {x.Value}"); // All Timestramps are the same
                Console.WriteLine();

                if (x.Index % 3 == 2)
                {                        
                    Console.WriteLine("Enter to continue");
                    Console.ReadLine();
                }
            });

I do not think that this is an issue - check the sampling interval, all counters for the same sample will have the same timestamp.

Felipe, open the file using PerfMon, that should be enough for you that it behaves as by design.

In this example, I was taking 1 sample/second.

Opening the the file using PerfMon I am able to see each sample time correctly. Maybe the UI is calculating it automatically?

image

In this case I could recommend you to try to use the latest Tx.Windows package. And please share the blg file itself if you can.

My mistake. I have a sample per process (instance), that's why I see multiple sample with the same timestamp. Sorry