CounterSample.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // System.Diagnostics.CounterSample.cs
  3. //
  4. // Authors:
  5. // Jonathan Pryor ([email protected])
  6. //
  7. // (C) 2002
  8. //
  9. using System;
  10. using System.Collections;
  11. using System.Diagnostics;
  12. namespace System.Diagnostics {
  13. public struct CounterSample {
  14. private long rawValue;
  15. private long baseValue;
  16. private long counterFrequency;
  17. private long systemFrequency;
  18. private long timeStamp;
  19. private long timeStamp100nSec;
  20. private long counterTimeStamp;
  21. private PerformanceCounterType counterType;
  22. CounterSample (long rawValue,
  23. long baseValue,
  24. long counterFrequency,
  25. long systemFrequency,
  26. long timeStamp,
  27. long timeStamp100nSec,
  28. PerformanceCounterType counterType)
  29. : this (rawValue, baseValue, counterFrequency,
  30. systemFrequency, timeStamp, timeStamp100nSec,
  31. counterType, 0)
  32. {
  33. }
  34. CounterSample (long rawValue,
  35. long baseValue,
  36. long counterFrequency,
  37. long systemFrequency,
  38. long timeStamp,
  39. long timeStamp100nSec,
  40. PerformanceCounterType counterType,
  41. long counterTimeStamp)
  42. {
  43. this.rawValue = rawValue;
  44. this.baseValue = baseValue;
  45. this.counterFrequency = counterFrequency;
  46. this.systemFrequency = systemFrequency;
  47. this.timeStamp = timeStamp;
  48. this.timeStamp100nSec = timeStamp100nSec;
  49. this.counterType = counterType;
  50. this.counterTimeStamp = counterTimeStamp;
  51. }
  52. public static CounterSample Empty = new CounterSample (
  53. 0, 0, 0, 0, 0, 0,
  54. PerformanceCounterType.NumberOfItems32,
  55. 0);
  56. public long BaseValue {
  57. get {return baseValue;}
  58. }
  59. public long CounterFrequency {
  60. get {return counterFrequency;}
  61. }
  62. public long CounterTimeStamp {
  63. get {return counterTimeStamp;}
  64. }
  65. public PerformanceCounterType CounterType {
  66. get {return counterType;}
  67. }
  68. public long RawValue {
  69. get {return rawValue;}
  70. }
  71. public long SystemFrequency {
  72. get {return systemFrequency;}
  73. }
  74. public long TimeStamp {
  75. get {return timeStamp;}
  76. }
  77. public long TimeStamp100nSec {
  78. get {return timeStamp100nSec;}
  79. }
  80. // [MonoTODO("What's the algorithm?")]
  81. // public static float Calculate (CounterSample counterSample)
  82. // {
  83. // throw new NotSupportedException ();
  84. // }
  85. //
  86. // [MonoTODO("What's the algorithm?")]
  87. // public static float Calculate (CounterSample counterSample,
  88. // CounterSample nextCounterSample)
  89. // {
  90. // throw new NotSupportedException ();
  91. // }
  92. }
  93. }