other sensors

This commit is contained in:
Martin Ptáček
2023-07-30 09:25:23 +02:00
parent 38fb26a63c
commit afcda1a448
3 changed files with 24 additions and 1 deletions

View File

@ -81,6 +81,9 @@ $ ansible-playbook ansible_playbook.yaml --tags config
`android_sensor_hinge_angle_degrees` - How much is the hinge opened
`android_sensor_accelerometer{axis}` - Data from the accelerometer
`android_sensor_magnetic_field_tesla{axis}` - Data from the magnetic field sensor in base units
`android_sensor_gravity_acceleration` - Data from gravity acceleration sensor, in m/s^2 units
`android_sensor_linear_acceleration` - Data from the Android linear acceleration sensor in m/s^2 units.
### Miscellaneous

View File

@ -179,6 +179,26 @@ class AndroidCustomExporter(private val metricEngine: MetricsEngine) : Collector
addAxisSpecificGauge(gauge, baseUnits)
mfs.add(gauge)
}
metricEngine.hwSensorsValues().gravityAcceleration?.let {
val gauge = GaugeMetricFamily(
"android_sensor_gravity_acceleration",
"Gravity acceleration sensor data in m/s^2",
listOf("axis")
)
addAxisSpecificGauge(gauge, it)
mfs.add(gauge)
}
metricEngine.hwSensorsValues().linearAcceleration?.let {
val gauge = GaugeMetricFamily(
"android_sensor_linear_acceleration",
"Data from the Android linear acceleration sensor in m/s^2 units.",
listOf("axis")
)
addAxisSpecificGauge(gauge, it)
mfs.add(gauge)
}
}
private fun collectScrapeDuration(mfs : MutableList<MetricFamilySamples>, startTime : Long){

View File

@ -42,7 +42,7 @@ class HwSensorsCache(
var pressureHectoPascal : Double? = null,
var proximityCentimeters : Double? = null, //DONE
var gravityAcceleration : AxisSpecificGauge? = null,
var gravityAcceleration : AxisSpecificGauge? = null, //DONE
var linearAcceleration : AxisSpecificGauge? = null,
var rotationVectorValues : AxisSpecificGauge? = null,
var rotationVectorCosinusThetaHalf : Double? = null,