mirror of https://github.com/jetkvm/kvm.git
feat(audio): add latency metrics collection for input and output
Add granular metrics collection for audio processing latency in both input and output paths. This enables better performance monitoring through histograms. Also update build tags to include ARM platform and rename UI label for clarity.
This commit is contained in:
parent
758bbbfff6
commit
f9adb4382d
|
@ -110,6 +110,12 @@ func (aim *AudioInputManager) WriteOpusFrame(frame []byte) error {
|
|||
atomic.AddInt64(&aim.framesSent, 1)
|
||||
aim.recordFrameProcessed(len(frame))
|
||||
aim.updateLatency(processingTime)
|
||||
|
||||
// Record latency to granular metrics collector for histogram
|
||||
if granularCollector := GetGranularMetricsCollector(); granularCollector != nil {
|
||||
granularCollector.RecordInputLatency(processingTime)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -145,6 +151,12 @@ func (aim *AudioInputManager) WriteOpusFrameZeroCopy(frame *ZeroCopyAudioFrame)
|
|||
atomic.AddInt64(&aim.framesSent, 1)
|
||||
aim.recordFrameProcessed(frame.Length())
|
||||
aim.updateLatency(processingTime)
|
||||
|
||||
// Record latency to granular metrics collector for histogram
|
||||
if granularCollector := GetGranularMetricsCollector(); granularCollector != nil {
|
||||
granularCollector.RecordInputLatency(processingTime)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,11 @@ func (aom *AudioOutputIPCManager) WriteOpusFrame(frame *ZeroCopyAudioFrame) erro
|
|||
aom.recordFrameProcessed(frame.Length())
|
||||
aom.updateLatency(processingTime)
|
||||
|
||||
// Record latency to granular metrics collector for histogram
|
||||
if granularCollector := GetGranularMetricsCollector(); granularCollector != nil {
|
||||
granularCollector.RecordOutputLatency(processingTime)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -132,6 +137,11 @@ func (aom *AudioOutputIPCManager) WriteOpusFrameZeroCopy(frame *ZeroCopyAudioFra
|
|||
aom.recordFrameProcessed(len(frameData))
|
||||
aom.updateLatency(processingTime)
|
||||
|
||||
// Record latency to granular metrics collector for histogram
|
||||
if granularCollector := GetGranularMetricsCollector(); granularCollector != nil {
|
||||
granularCollector.RecordOutputLatency(processingTime)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//go:build cgo
|
||||
// +build cgo
|
||||
//go:build cgo || arm
|
||||
// +build cgo arm
|
||||
|
||||
package audio
|
||||
|
||||
|
|
|
@ -478,7 +478,7 @@ export default function AudioMetricsDashboard() {
|
|||
<div className="mb-2 flex items-center gap-2">
|
||||
<MdMic className="h-4 w-4 text-green-600 dark:text-green-400" />
|
||||
<span className="font-medium text-slate-900 dark:text-slate-100">
|
||||
Microphone Input Config
|
||||
Audio Input Config
|
||||
</span>
|
||||
</div>
|
||||
<div className="space-y-2 text-sm">
|
||||
|
|
Loading…
Reference in New Issue