fix(platform): avoid fake kafka lag
This commit is contained in:
@@ -32,12 +32,13 @@ func NewMockStore() *MockStore {
|
||||
}
|
||||
|
||||
func (m *MockStore) DashboardSummary(context.Context) (DashboardSummary, error) {
|
||||
kafkaLag := 0
|
||||
return DashboardSummary{
|
||||
OnlineVehicles: 3,
|
||||
ActiveToday: 4,
|
||||
FrameToday: 1286320,
|
||||
IssueVehicles: 7,
|
||||
KafkaLag: 0,
|
||||
KafkaLag: &kafkaLag,
|
||||
Protocols: []ProtocolStat{
|
||||
{Protocol: "GB32960", Online: 18, Total: 64},
|
||||
{Protocol: "JT808", Online: 73, Total: 318},
|
||||
|
||||
@@ -12,7 +12,7 @@ type DashboardSummary struct {
|
||||
ActiveToday int `json:"activeToday"`
|
||||
FrameToday int `json:"frameToday"`
|
||||
IssueVehicles int `json:"issueVehicles"`
|
||||
KafkaLag int `json:"kafkaLag"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
Protocols []ProtocolStat `json:"protocols"`
|
||||
LinkHealth []LinkHealth `json:"linkHealth"`
|
||||
}
|
||||
@@ -134,7 +134,7 @@ type QualityIssueRow struct {
|
||||
|
||||
type OpsHealth struct {
|
||||
LinkHealth []LinkHealth `json:"linkHealth"`
|
||||
KafkaLag int `json:"kafkaLag"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
RedisOnlineKeys int `json:"redisOnlineKeys"`
|
||||
TDengineWritable bool `json:"tdengineWritable"`
|
||||
MySQLWritable bool `json:"mysqlWritable"`
|
||||
|
||||
@@ -385,8 +385,8 @@ func (s *ProductionStore) OpsHealth(ctx context.Context) (OpsHealth, error) {
|
||||
{Name: "vehicle_realtime_snapshot", Status: "ok", Detail: "读取实时快照表"},
|
||||
{Name: "vehicle_realtime_location", Status: "ok", Detail: "读取实时位置表"},
|
||||
{Name: "TDengine raw_frames", Status: tdengineStatus(s.tdengine), Detail: tdengineDetail(s.tdengine)},
|
||||
{Name: "Kafka lag", Status: "warning", Detail: "平台暂未接入 Kafka consumer lag 监控"},
|
||||
},
|
||||
KafkaLag: 0,
|
||||
RedisOnlineKeys: redisKeys,
|
||||
TDengineWritable: s.tdengine != nil,
|
||||
MySQLWritable: mysqlStatus == "ok",
|
||||
|
||||
Reference in New Issue
Block a user