修复延迟检测错误
This commit is contained in:
@@ -48,7 +48,8 @@ async function pollLatency() {
|
||||
// Try specialized metrics first for better accuracy
|
||||
const priorityMetrics = ['probe_icmp_duration_seconds', 'probe_http_duration_seconds', 'probe_duration_seconds'];
|
||||
for (const metricName of priorityMetrics) {
|
||||
const regex = new RegExp(`^${metricName}(?:\\{.*\\})?\\s+([\\d.]+)`);
|
||||
// Support scientific notation (e.g. 1.23e-04)
|
||||
const regex = new RegExp(`^${metricName}(?:\\{.*\\})?\\s+([\\d.eE+-]+)`);
|
||||
for (const line of lines) {
|
||||
const match = line.match(regex);
|
||||
if (match) {
|
||||
|
||||
Reference in New Issue
Block a user