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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Representation of measurable sensors.
//!
//! This module defines the structures used to describe sensors collected
//! by `JouleProfiler`. Sensors are associated with metric sources and are
//! used to represent individual measurements.
use Serialize;
use crateMetricUnit;
/// Represents a measurable sensor.
///
/// A sensor corresponds to a metric collected from a source.
///
/// # Examples
///
/// ```no_run
/// use joule_profiler_core::{
/// sensor::Sensor,
/// unit::{MetricUnit, UnitPrefix, Unit},
/// };
///
/// let micro_joule_unit: MetricUnit = MetricUnit {
/// prefix: UnitPrefix::Micro,
/// unit: Unit::Joule,
/// };
///
/// let sensor = Sensor::new("CORE-0", micro_joule_unit, "powercap");
///
/// assert_eq!(sensor.name, "CORE-0");
/// assert_eq!(sensor.unit.to_string(), "µJ");
/// assert_eq!(sensor.source, "powercap");
/// ```
/// A collection of sensors.
pub type Sensors = ;