2 // System.Diagnostics.CounterSample.cs
5 // Jonathan Pryor (jonpryor@vt.edu)
11 using System.Collections;
12 using System.Diagnostics;
14 namespace System.Diagnostics {
16 public struct CounterSample {
18 private long rawValue;
19 private long baseValue;
20 private long counterFrequency;
21 private long systemFrequency;
22 private long timeStamp;
23 private long timeStamp100nSec;
24 private long counterTimeStamp;
25 private PerformanceCounterType counterType;
27 CounterSample (long rawValue,
29 long counterFrequency,
32 long timeStamp100nSec,
33 PerformanceCounterType counterType)
34 : this (rawValue, baseValue, counterFrequency,
35 systemFrequency, timeStamp, timeStamp100nSec,
40 CounterSample (long rawValue,
42 long counterFrequency,
45 long timeStamp100nSec,
46 PerformanceCounterType counterType,
47 long counterTimeStamp)
49 this.rawValue = rawValue;
50 this.baseValue = baseValue;
51 this.counterFrequency = counterFrequency;
52 this.systemFrequency = systemFrequency;
53 this.timeStamp = timeStamp;
54 this.timeStamp100nSec = timeStamp100nSec;
55 this.counterType = counterType;
56 this.counterTimeStamp = counterTimeStamp;
59 public static CounterSample Empty = new CounterSample (
61 PerformanceCounterType.NumberOfItems32,
64 public long BaseValue {
65 get {return baseValue;}
68 public long CounterFrequency {
69 get {return counterFrequency;}
72 public long CounterTimeStamp {
73 get {return counterTimeStamp;}
76 public PerformanceCounterType CounterType {
77 get {return counterType;}
80 public long RawValue {
81 get {return rawValue;}
84 public long SystemFrequency {
85 get {return systemFrequency;}
88 public long TimeStamp {
89 get {return timeStamp;}
92 public long TimeStamp100nSec {
93 get {return timeStamp100nSec;}
96 // [MonoTODO("What's the algorithm?")]
97 // public static float Calculate (CounterSample counterSample)
99 // throw new NotSupportedException ();
102 // [MonoTODO("What's the algorithm?")]
103 // public static float Calculate (CounterSample counterSample,
104 // CounterSample nextCounterSample)
106 // throw new NotSupportedException ();