ci: restore lesavka quality telemetry publishing
This commit is contained in:
parent
345b9b6158
commit
1473660f68
@ -20,9 +20,9 @@ use std::{
|
|||||||
thread,
|
thread,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use tracing::{debug, warn};
|
use tracing::{debug, info, warn};
|
||||||
#[cfg(not(coverage))]
|
#[cfg(not(coverage))]
|
||||||
use tracing::{error, info, trace};
|
use tracing::{error, trace};
|
||||||
|
|
||||||
const MIC_GAIN_ENV: &str = "LESAVKA_MIC_GAIN";
|
const MIC_GAIN_ENV: &str = "LESAVKA_MIC_GAIN";
|
||||||
const MIC_GAIN_CONTROL_ENV: &str = "LESAVKA_MIC_GAIN_CONTROL";
|
const MIC_GAIN_CONTROL_ENV: &str = "LESAVKA_MIC_GAIN_CONTROL";
|
||||||
|
|||||||
@ -100,7 +100,7 @@ publish_metrics() {
|
|||||||
|
|
||||||
curl --fail --silent --show-error \
|
curl --fail --silent --show-error \
|
||||||
--data-binary @"${METRICS_FILE}" \
|
--data-binary @"${METRICS_FILE}" \
|
||||||
"${PUSHGATEWAY_URL%/}/metrics/job/platform-quality-ci/suite/lesavka"
|
"${PUSHGATEWAY_URL%/}/metrics/job/platform-quality-ci/suite/lesavka/gate/quality"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_fallback_quality_metrics() {
|
write_fallback_quality_metrics() {
|
||||||
|
|||||||
@ -166,6 +166,7 @@ struct UvcVideoStream {
|
|||||||
buffers: Vec<MmapBuffer>,
|
buffers: Vec<MmapBuffer>,
|
||||||
frame_path: std::path::PathBuf,
|
frame_path: std::path::PathBuf,
|
||||||
latest_frame: Vec<u8>,
|
latest_frame: Vec<u8>,
|
||||||
|
stats: UvcVideoStats,
|
||||||
frame_max_bytes: usize,
|
frame_max_bytes: usize,
|
||||||
frame_period: Option<std::time::Duration>,
|
frame_period: Option<std::time::Duration>,
|
||||||
next_queue_at: Option<std::time::Instant>,
|
next_queue_at: Option<std::time::Instant>,
|
||||||
@ -196,6 +197,7 @@ impl UvcVideoStream {
|
|||||||
buffers: Vec::new(),
|
buffers: Vec::new(),
|
||||||
frame_path: frame_spool_path(),
|
frame_path: frame_spool_path(),
|
||||||
latest_frame: IDLE_MJPEG_FRAME.to_vec(),
|
latest_frame: IDLE_MJPEG_FRAME.to_vec(),
|
||||||
|
stats: UvcVideoStats::default(),
|
||||||
frame_max_bytes: MAX_MJPEG_FRAME_BYTES,
|
frame_max_bytes: MAX_MJPEG_FRAME_BYTES,
|
||||||
frame_period: None,
|
frame_period: None,
|
||||||
next_queue_at: None,
|
next_queue_at: None,
|
||||||
@ -210,12 +212,26 @@ impl UvcVideoStream {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let max_frame_bytes = self.frame_payload_limit();
|
let max_frame_bytes = self.frame_payload_limit();
|
||||||
if let Ok(frame) = std::fs::read(&self.frame_path)
|
if let Ok(frame) = std::fs::read(&self.frame_path) {
|
||||||
&& frame.len() <= max_frame_bytes
|
if frame.len() <= max_frame_bytes && looks_like_mjpeg_frame(&frame) {
|
||||||
&& looks_like_mjpeg_frame(&frame)
|
self.stats.reloaded += 1;
|
||||||
{
|
self.stats.latest_bytes = frame.len();
|
||||||
self.latest_frame = frame;
|
self.latest_frame = frame;
|
||||||
|
} else {
|
||||||
|
if frame.len() > max_frame_bytes && looks_like_mjpeg_frame(&frame) {
|
||||||
|
self.stats.rejected_oversize += 1;
|
||||||
|
self.stats.last_rejected_oversize_bytes = frame.len();
|
||||||
|
self.stats.last_rejected_oversize_cap = max_frame_bytes;
|
||||||
|
} else {
|
||||||
|
self.stats.rejected_invalid += 1;
|
||||||
|
}
|
||||||
|
if !looks_like_mjpeg_frame(&self.latest_frame) {
|
||||||
|
self.stats.fallback_idle += 1;
|
||||||
|
self.latest_frame = IDLE_MJPEG_FRAME.to_vec();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if !looks_like_mjpeg_frame(&self.latest_frame) {
|
} else if !looks_like_mjpeg_frame(&self.latest_frame) {
|
||||||
|
self.stats.fallback_idle += 1;
|
||||||
self.latest_frame = IDLE_MJPEG_FRAME.to_vec();
|
self.latest_frame = IDLE_MJPEG_FRAME.to_vec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user