feat(platform): expose vehicle service runtime health

This commit is contained in:
lingniu
2026-07-04 01:02:07 +08:00
parent 377cfcdfca
commit 3e76210d7d
6 changed files with 53 additions and 6 deletions

View File

@@ -20,6 +20,11 @@ function storageReadStatus(health: OpsHealth | null) {
return health?.tdengineWritable && health.mysqlWritable ? 'ok' : 'error';
}
function formatRequestTimeout(health: OpsHealth | null) {
const value = health?.runtime?.requestTimeoutMs;
return value == null || value <= 0 ? '未限制' : `${value.toLocaleString()} ms`;
}
const emptySummary: QualitySummary = {
issueVehicleCount: 0,
issueRecordCount: 0,
@@ -125,9 +130,10 @@ export function Quality({
))}
</div>
<Row gutter={16}>
<Col span={8}><Card bordered title="Kafka Lag">{formatLag(health?.kafkaLag)}</Card></Col>
<Col span={8}><Card bordered title="Redis 在线 Key">{formatLag(health?.redisOnlineKeys)}</Card></Col>
<Col span={8}>
<Col span={6}><Card bordered title="Kafka Lag">{formatLag(health?.kafkaLag)}</Card></Col>
<Col span={6}><Card bordered title="Redis 在线 Key">{formatLag(health?.redisOnlineKeys)}</Card></Col>
<Col span={6}><Card bordered title="BFF 请求超时">{formatRequestTimeout(health)}</Card></Col>
<Col span={6}>
<Card bordered title="存储读取">
<Tag color={statusColor[storageReadStatus(health)]}>{storageReadStatus(health) === 'ok' ? '正常' : '异常'}</Tag>
</Card>