ReportedValue.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. namespace OhmGraphite
  2. {
  3. public class ReportedValue
  4. {
  5. public ReportedValue(string identifier,
  6. string sensor,
  7. float value,
  8. SensorType sensorType,
  9. string hardware,
  10. HardwareType hardwareType,
  11. string hwInstance,
  12. int sensorIndex)
  13. {
  14. Identifier = identifier;
  15. Sensor = sensor;
  16. Value = value;
  17. SensorType = sensorType;
  18. Hardware = hardware;
  19. HardwareType = hardwareType;
  20. SensorIndex = sensorIndex;
  21. HardwareInstance = hwInstance;
  22. }
  23. /// <summary>
  24. /// A globally unique identifier for each metric. Eg: /amdcpu/0/power/5. This
  25. /// identifier can be read as "The 6th power sensor on the 1st amd cpu"
  26. /// </summary>
  27. public string Identifier { get; }
  28. /// <summary>
  29. /// Descriptive name for sensor. Eg: CPU Core #10
  30. /// </summary>
  31. public string Sensor { get; }
  32. /// <summary>
  33. /// The reported sensor reading
  34. /// </summary>
  35. public float Value { get; }
  36. /// <summary>
  37. /// The type of sensor
  38. /// </summary>
  39. public SensorType SensorType { get; }
  40. /// <summary>
  41. /// Descriptive name for the hardware. Eg: AMD Ryzen 7 2700. Note
  42. /// that this name does not need to be unique among hardware types such
  43. /// as in multi-gpu or multi-hdd setups
  44. /// </summary>
  45. public string Hardware { get; }
  46. /// <summary>
  47. /// The type of hardware the sensor is monitoring
  48. /// </summary>
  49. public HardwareType HardwareType { get; }
  50. /// <summary>
  51. /// The index. The "5" in /amdcpu/0/power/5. There typically isn't
  52. /// ambiguity for sensors as they have differing names
  53. /// (else wouldn't they be measuring the same thing?)
  54. /// </summary>
  55. public int SensorIndex { get; }
  56. /// <summary>
  57. /// The disambiguation factor for same hardware (multi-gpu and multi-hdd).
  58. /// This is typically the index of the hardware found in the identifier
  59. /// (eg: the "0" in /amdcpu/0/power/5). It's not always the index, for
  60. /// NIC sensors, the NIC's GUID is used.
  61. /// </summary>
  62. public string HardwareInstance { get; }
  63. }
  64. }