feat: static mock data for executions, routes, agents, metrics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-18 10:06:38 +01:00
parent 332cf18d1d
commit cd0d02a61b
4 changed files with 670 additions and 0 deletions

69
src/mocks/agents.ts Normal file
View File

@@ -0,0 +1,69 @@
import type { Agent } from '../design-system/layout/Sidebar/Sidebar'
export interface AgentHealth extends Agent {
uptime: string
memoryUsagePct: number
cpuUsagePct: number
activeRoutes: number
totalRoutes: number
}
export const agents: AgentHealth[] = [
{
id: 'prod-1',
name: 'prod-1',
service: 'order-service',
version: 'v3.2.1',
tps: '14.2/s',
lastSeen: '12s ago',
status: 'live',
uptime: '14d 6h',
memoryUsagePct: 62,
cpuUsagePct: 24,
activeRoutes: 3,
totalRoutes: 3,
},
{
id: 'prod-2',
name: 'prod-2',
service: 'payment-svc',
version: 'v3.2.1',
tps: '11.8/s',
lastSeen: '8s ago',
status: 'live',
errorRate: '3 err/h',
uptime: '14d 6h',
memoryUsagePct: 71,
cpuUsagePct: 31,
activeRoutes: 2,
totalRoutes: 2,
},
{
id: 'prod-3',
name: 'prod-3',
service: 'shipment-svc',
version: 'v3.2.0',
tps: '12.1/s',
lastSeen: '5s ago',
status: 'live',
uptime: '7d 14h',
memoryUsagePct: 55,
cpuUsagePct: 19,
activeRoutes: 2,
totalRoutes: 2,
},
{
id: 'prod-4',
name: 'prod-4',
service: 'shipment-svc',
version: 'v3.2.0',
tps: '9.1/s',
lastSeen: '3s ago',
status: 'live',
uptime: '7d 14h',
memoryUsagePct: 48,
cpuUsagePct: 15,
activeRoutes: 2,
totalRoutes: 2,
},
]

302
src/mocks/executions.ts Normal file
View File

@@ -0,0 +1,302 @@
export interface ProcessorData {
name: string
type: string
durationMs: number
status: 'ok' | 'slow' | 'fail'
startMs: number
}
export interface Execution {
id: string
orderId: string
customer: string
route: string
routeGroup: string
status: 'completed' | 'failed' | 'running' | 'warning'
durationMs: number
timestamp: Date
correlationId: string
agent: string
errorMessage?: string
errorClass?: string
processors: ProcessorData[]
}
export const executions: Execution[] = [
{
id: 'E-2026-03-18-00201',
orderId: 'OP-92184',
customer: 'CUST-44210',
route: 'order-intake',
routeGroup: 'order-flow',
status: 'completed',
durationMs: 87,
timestamp: new Date('2026-03-18T09:12:04'),
correlationId: 'cmr-f4a1c82b-9d3e',
agent: 'prod-1',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 4, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 6, status: 'ok', startMs: 4 },
{ name: 'validate(schema)', type: 'process', durationMs: 10, status: 'ok', startMs: 10 },
{ name: 'enrich(customer-db)', type: 'enrich', durationMs: 52, status: 'ok', startMs: 20 },
{ name: 'to(order-enrichment)', type: 'to', durationMs: 15, status: 'ok', startMs: 72 },
],
},
{
id: 'E-2026-03-18-00200',
orderId: 'OP-92183',
customer: 'CUST-18773',
route: 'payment-validate',
routeGroup: 'payment-flow',
status: 'completed',
durationMs: 164,
timestamp: new Date('2026-03-18T09:11:22'),
correlationId: 'cmr-7b2d9f14-c5a8',
agent: 'prod-2',
processors: [
{ name: 'from(jms:payments)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 8, status: 'ok', startMs: 5 },
{ name: 'validate(payment-schema)', type: 'process', durationMs: 15, status: 'ok', startMs: 13 },
{ name: 'check(fraud-service)', type: 'enrich', durationMs: 112, status: 'ok', startMs: 28 },
{ name: 'to(payment-process)', type: 'to', durationMs: 24, status: 'ok', startMs: 140 },
],
},
{
id: 'E-2026-03-18-00202',
orderId: 'OP-92185',
customer: 'CUST-67501',
route: 'order-enrichment',
routeGroup: 'order-flow',
status: 'running',
durationMs: 30000,
timestamp: new Date('2026-03-18T09:13:44'),
correlationId: 'cmr-3c8e1a7f-d2b6',
agent: 'prod-1',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'enrich(inventory-api)', type: 'enrich', durationMs: 29990, status: 'slow', startMs: 5 },
],
},
{
id: 'E-2026-03-18-00198',
orderId: 'OP-92180',
customer: 'CUST-55019',
route: 'shipment-dispatch',
routeGroup: 'shipment-flow',
status: 'warning',
durationMs: 248,
timestamp: new Date('2026-03-18T09:09:47'),
correlationId: 'cmr-a9f3b2c1-e4d7',
agent: 'prod-3',
processors: [
{ name: 'from(jms:shipments)', type: 'consumer', durationMs: 6, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 8, status: 'ok', startMs: 6 },
{ name: 'enrich(carrier-api)', type: 'enrich', durationMs: 198, status: 'slow', startMs: 14 },
{ name: 'to(carrier-gateway)', type: 'to', durationMs: 36, status: 'ok', startMs: 212 },
],
},
{
id: 'E-2026-03-18-00191',
orderId: 'OP-88421',
customer: 'CUST-31094',
route: 'payment-process',
routeGroup: 'payment-flow',
status: 'failed',
durationMs: 412,
timestamp: new Date('2026-03-18T09:06:11'),
correlationId: 'cmr-9a4f2b71-e8c3',
agent: 'prod-2',
errorMessage: 'org.apache.camel.CamelExecutionException: Payment gateway timeout after 5000ms — POST https://pay.provider.com/v2/charge returned HTTP 504. Retry exhausted (3/3).',
errorClass: 'org.apache.camel.CamelExecutionException',
processors: [
{ name: 'from(jms:payments)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 8, status: 'ok', startMs: 5 },
{ name: 'validate(payment-schema)', type: 'process', durationMs: 12, status: 'ok', startMs: 13 },
{ name: 'to(payment-gateway)', type: 'to', durationMs: 387, status: 'fail', startMs: 25 },
],
},
{
id: 'E-2026-03-18-00189',
orderId: 'OP-88419',
customer: 'CUST-72841',
route: 'order-enrichment',
routeGroup: 'order-flow',
status: 'failed',
durationMs: 1247,
timestamp: new Date('2026-03-18T09:02:38'),
correlationId: 'cmr-b6d7c3a2-f1e9',
agent: 'prod-1',
errorMessage: 'java.sql.SQLTransientConnectionException: HikariPool-1 - Connection not available, request timed out after 1000ms. (pool: 10, active: 10, idle: 0, waiting: 3)',
errorClass: 'java.sql.SQLTransientConnectionException',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 9, status: 'ok', startMs: 5 },
{ name: 'enrich(customer-db)', type: 'enrich', durationMs: 1233, status: 'fail', startMs: 14 },
],
},
{
id: 'E-2026-03-18-00186',
orderId: 'OP-92179',
customer: 'CUST-90123',
route: 'order-intake',
routeGroup: 'order-flow',
status: 'completed',
durationMs: 62,
timestamp: new Date('2026-03-18T09:00:15'),
correlationId: 'cmr-2e5f8d9a-b4c1',
agent: 'prod-3',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 3, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 5, status: 'ok', startMs: 3 },
{ name: 'validate(schema)', type: 'process', durationMs: 8, status: 'ok', startMs: 8 },
{ name: 'enrich(customer-db)', type: 'enrich', durationMs: 34, status: 'ok', startMs: 16 },
{ name: 'to(order-enrichment)', type: 'to', durationMs: 12, status: 'ok', startMs: 50 },
],
},
{
id: 'E-2026-03-18-00184',
orderId: 'OP-92178',
customer: 'CUST-44210',
route: 'payment-validate',
routeGroup: 'payment-flow',
status: 'completed',
durationMs: 131,
timestamp: new Date('2026-03-18T08:58:33'),
correlationId: 'cmr-d1a3e7f4-c2b8',
agent: 'prod-1',
processors: [
{ name: 'from(jms:payments)', type: 'consumer', durationMs: 4, status: 'ok', startMs: 0 },
{ name: 'validate(payment-schema)', type: 'process', durationMs: 14, status: 'ok', startMs: 4 },
{ name: 'check(fraud-service)', type: 'enrich', durationMs: 88, status: 'ok', startMs: 18 },
{ name: 'to(payment-process)', type: 'to', durationMs: 25, status: 'ok', startMs: 106 },
],
},
{
id: 'E-2026-03-18-00179',
orderId: 'OP-92175',
customer: 'CUST-67892',
route: 'shipment-track',
routeGroup: 'shipment-flow',
status: 'completed',
durationMs: 94,
timestamp: new Date('2026-03-18T08:53:07'),
correlationId: 'cmr-e8b2c9d4-a7f3',
agent: 'prod-4',
processors: [
{ name: 'from(jms:tracking)', type: 'consumer', durationMs: 4, status: 'ok', startMs: 0 },
{ name: 'enrich(carrier-api)', type: 'enrich', durationMs: 72, status: 'ok', startMs: 4 },
{ name: 'to(notification-hub)', type: 'to', durationMs: 18, status: 'ok', startMs: 76 },
],
},
{
id: 'E-2026-03-18-00177',
orderId: 'OP-92174',
customer: 'CUST-15293',
route: 'order-intake',
routeGroup: 'order-flow',
status: 'completed',
durationMs: 73,
timestamp: new Date('2026-03-18T08:50:41'),
correlationId: 'cmr-f3c7a1b9-d5e2',
agent: 'prod-1',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 3, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 6, status: 'ok', startMs: 3 },
{ name: 'validate(schema)', type: 'process', durationMs: 9, status: 'ok', startMs: 9 },
{ name: 'enrich(customer-db)', type: 'enrich', durationMs: 40, status: 'ok', startMs: 18 },
{ name: 'to(order-enrichment)', type: 'to', durationMs: 15, status: 'ok', startMs: 58 },
],
},
{
id: 'E-2026-03-18-00173',
orderId: 'OP-92173',
customer: 'CUST-88104',
route: 'payment-process',
routeGroup: 'payment-flow',
status: 'completed',
durationMs: 198,
timestamp: new Date('2026-03-18T08:46:19'),
correlationId: 'cmr-a2d8f5c3-b9e1',
agent: 'prod-2',
processors: [
{ name: 'from(jms:payments)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'validate(payment-schema)', type: 'process', durationMs: 12, status: 'ok', startMs: 5 },
{ name: 'to(payment-gateway)', type: 'to', durationMs: 156, status: 'ok', startMs: 17 },
{ name: 'to(order-service)', type: 'to', durationMs: 25, status: 'ok', startMs: 173 },
],
},
{
id: 'E-2026-03-18-00164',
orderId: 'OP-92170',
customer: 'CUST-50321',
route: 'order-enrichment',
routeGroup: 'order-flow',
status: 'warning',
durationMs: 267,
timestamp: new Date('2026-03-18T08:39:52'),
correlationId: 'cmr-c4f1b7a8-e3d6',
agent: 'prod-1',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 8, status: 'ok', startMs: 5 },
{ name: 'enrich(inventory-api)', type: 'enrich', durationMs: 224, status: 'slow', startMs: 13 },
{ name: 'to(payment-process)', type: 'to', durationMs: 30, status: 'ok', startMs: 237 },
],
},
{
id: 'E-2026-03-18-00158',
orderId: 'OP-88412',
customer: 'CUST-23781',
route: 'payment-process',
routeGroup: 'payment-flow',
status: 'failed',
durationMs: 5234,
timestamp: new Date('2026-03-18T08:31:05'),
correlationId: 'cmr-7e9a2c5f-d1b4',
agent: 'prod-2',
errorMessage: 'org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking https://pay.provider.com/v2/charge with statusCode: 422 — Unprocessable Entity: card declined (insufficient funds)',
errorClass: 'org.apache.camel.component.http.HttpOperationFailedException',
processors: [
{ name: 'from(jms:payments)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'validate(payment-schema)', type: 'process', durationMs: 11, status: 'ok', startMs: 5 },
{ name: 'to(payment-gateway)', type: 'to', durationMs: 5218, status: 'fail', startMs: 16 },
],
},
{
id: 'E-2026-03-18-00151',
orderId: 'OP-92166',
customer: 'CUST-61042',
route: 'shipment-dispatch',
routeGroup: 'shipment-flow',
status: 'completed',
durationMs: 112,
timestamp: new Date('2026-03-18T08:22:44'),
correlationId: 'cmr-b5c8d2a7-f4e3',
agent: 'prod-3',
processors: [
{ name: 'from(jms:shipments)', type: 'consumer', durationMs: 5, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 7, status: 'ok', startMs: 5 },
{ name: 'enrich(carrier-api)', type: 'enrich', durationMs: 80, status: 'ok', startMs: 12 },
{ name: 'to(carrier-gateway)', type: 'to', durationMs: 20, status: 'ok', startMs: 92 },
],
},
{
id: 'E-2026-03-18-00144',
orderId: 'OP-92161',
customer: 'CUST-77215',
route: 'order-intake',
routeGroup: 'order-flow',
status: 'completed',
durationMs: 91,
timestamp: new Date('2026-03-18T08:15:19'),
correlationId: 'cmr-d9e3f7b1-a6c5',
agent: 'prod-4',
processors: [
{ name: 'from(jms:orders)', type: 'consumer', durationMs: 4, status: 'ok', startMs: 0 },
{ name: 'unmarshal(json)', type: 'transform', durationMs: 7, status: 'ok', startMs: 4 },
{ name: 'validate(schema)', type: 'process', durationMs: 10, status: 'ok', startMs: 11 },
{ name: 'enrich(customer-db)', type: 'enrich', durationMs: 54, status: 'ok', startMs: 21 },
{ name: 'to(order-enrichment)', type: 'to', durationMs: 16, status: 'ok', startMs: 75 },
],
},
]

200
src/mocks/metrics.ts Normal file
View File

@@ -0,0 +1,200 @@
export interface KpiMetric {
label: string
value: string | number
unit?: string
trend: 'up' | 'down' | 'neutral'
trendValue: string
trendSentiment: 'good' | 'bad' | 'neutral'
detail: string
accent: 'amber' | 'success' | 'error' | 'running' | 'warning'
sparkline: number[]
}
export interface TimeSeriesPoint {
timestamp: Date
value: number
}
export interface MetricSeries {
label: string
data: TimeSeriesPoint[]
}
// Generate a realistic time series for the past shift (06:00 - now ~09:15)
function generateTimeSeries(
baseValue: number,
variance: number,
points: number,
startHour = 6,
): TimeSeriesPoint[] {
const result: TimeSeriesPoint[] = []
const now = new Date('2026-03-18T09:15:00')
const start = new Date('2026-03-18T06:00:00')
const totalMs = now.getTime() - start.getTime()
const interval = totalMs / points
for (let i = 0; i <= points; i++) {
const ts = new Date(start.getTime() + i * interval)
const noise = (Math.random() - 0.5) * 2 * variance
const trend = (i / points) * (baseValue * 0.1) // slight upward trend
result.push({ timestamp: ts, value: Math.max(0, baseValue + noise + trend) })
}
return result
}
// KPI stat cards data
export const kpiMetrics: KpiMetric[] = [
{
label: 'Executions (shift)',
value: '3,241',
trend: 'up',
trendValue: '+12%',
trendSentiment: 'good',
detail: '97.1% success since 06:00',
accent: 'amber',
sparkline: [28, 32, 29, 35, 38, 41, 37, 44, 42, 47, 45, 51, 48, 52],
},
{
label: 'Success Rate',
value: '97.1%',
trend: 'down',
trendValue: '-0.4%',
trendSentiment: 'bad',
detail: '3,147 ok / 56 warn / 38 error',
accent: 'success',
sparkline: [98.2, 97.9, 98.1, 97.8, 97.5, 97.6, 97.4, 97.2, 97.3, 97.1, 97.0, 97.1, 97.2, 97.1],
},
{
label: 'Errors (shift)',
value: 38,
trend: 'up',
trendValue: '+5',
trendSentiment: 'bad',
detail: '23 overnight · 15 since 06:00',
accent: 'error',
sparkline: [1, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8],
},
{
label: 'Throughput',
value: '47.2',
unit: 'msg/s',
trend: 'neutral',
trendValue: '→',
trendSentiment: 'neutral',
detail: 'Capacity: 120 msg/s · 39%',
accent: 'running',
sparkline: [44, 46, 45, 47, 48, 46, 47, 48, 46, 47, 48, 47, 46, 47],
},
{
label: 'Latency p99',
value: 287,
unit: 'ms',
trend: 'up',
trendValue: '+23ms',
trendSentiment: 'bad',
detail: 'SLA: <300ms · CLOSE',
accent: 'warning',
sparkline: [198, 212, 205, 218, 224, 231, 238, 245, 252, 261, 268, 275, 281, 287],
},
]
// Time series chart data
export const throughputSeries: MetricSeries[] = [
{
label: 'order-service',
data: generateTimeSeries(47, 8, 40),
},
{
label: 'payment-svc',
data: generateTimeSeries(28, 5, 40),
},
{
label: 'shipment-svc',
data: generateTimeSeries(19, 4, 40),
},
]
export const latencySeries: MetricSeries[] = [
{
label: 'p50',
data: generateTimeSeries(98, 15, 40),
},
{
label: 'p95',
data: generateTimeSeries(187, 25, 40),
},
{
label: 'p99',
data: generateTimeSeries(258, 35, 40),
},
]
export const errorCountSeries: MetricSeries[] = [
{
label: 'payment-flow',
data: generateTimeSeries(12, 4, 40),
},
{
label: 'order-flow',
data: generateTimeSeries(8, 3, 40),
},
{
label: 'shipment-flow',
data: generateTimeSeries(4, 2, 40),
},
]
// Route-level metrics summary
export interface RouteMetricRow {
routeId: string
routeName: string
execCount: number
successRate: number
avgDurationMs: number
p99DurationMs: number
errorCount: number
sparkline: number[]
}
export const routeMetrics: RouteMetricRow[] = [
{
routeId: 'order-intake',
routeName: 'order-intake',
execCount: 892,
successRate: 99.2,
avgDurationMs: 88,
p99DurationMs: 142,
errorCount: 7,
sparkline: [82, 86, 84, 88, 91, 87, 90, 88, 85, 89, 88, 86, 89, 88],
},
{
routeId: 'order-enrichment',
routeName: 'order-enrichment',
execCount: 541,
successRate: 97.6,
avgDurationMs: 156,
p99DurationMs: 287,
errorCount: 13,
sparkline: [142, 148, 152, 158, 162, 155, 159, 164, 156, 160, 154, 158, 156, 156],
},
{
routeId: 'payment-process',
routeName: 'payment-process',
execCount: 414,
successRate: 96.1,
avgDurationMs: 234,
p99DurationMs: 412,
errorCount: 16,
sparkline: [210, 225, 232, 218, 241, 235, 228, 242, 238, 231, 244, 237, 233, 234],
},
{
routeId: 'shipment-dispatch',
routeName: 'shipment-dispatch',
execCount: 387,
successRate: 98.4,
avgDurationMs: 118,
p99DurationMs: 248,
errorCount: 6,
sparkline: [112, 115, 118, 114, 120, 116, 119, 117, 118, 121, 116, 118, 119, 118],
},
]

99
src/mocks/routes.ts Normal file
View File

@@ -0,0 +1,99 @@
export interface RouteDefinition {
id: string
name: string
group: string
description: string
execCount: number
successRate: number
avgDurationMs: number
p99DurationMs: number
status: 'healthy' | 'degraded' | 'down'
processors: string[]
}
export const routes: RouteDefinition[] = [
{
id: 'order-intake',
name: 'order-intake',
group: 'order-flow',
description: 'Ingests new orders from JMS queue, validates schema, enriches with customer data',
execCount: 892,
successRate: 99.2,
avgDurationMs: 88,
p99DurationMs: 142,
status: 'healthy',
processors: ['from(jms:orders)', 'unmarshal(json)', 'validate(schema)', 'enrich(customer-db)', 'to(order-enrichment)'],
},
{
id: 'order-enrichment',
name: 'order-enrichment',
group: 'order-flow',
description: 'Enriches order with inventory availability, pricing, and shipment options',
execCount: 541,
successRate: 97.6,
avgDurationMs: 156,
p99DurationMs: 287,
status: 'degraded',
processors: ['from(jms:orders-enriched)', 'enrich(inventory-api)', 'enrich(pricing-service)', 'to(payment-process)'],
},
{
id: 'payment-process',
name: 'payment-process',
group: 'payment-flow',
description: 'Processes payment through gateway, handles retries and partial failures',
execCount: 414,
successRate: 96.1,
avgDurationMs: 234,
p99DurationMs: 412,
status: 'degraded',
processors: ['from(jms:payments)', 'validate(payment-schema)', 'to(payment-gateway)', 'to(order-service)'],
},
{
id: 'payment-validate',
name: 'payment-validate',
group: 'payment-flow',
description: 'Validates payment details and performs fraud check before processing',
execCount: 498,
successRate: 99.8,
avgDurationMs: 142,
p99DurationMs: 198,
status: 'healthy',
processors: ['from(jms:payments)', 'validate(payment-schema)', 'check(fraud-service)', 'to(payment-process)'],
},
{
id: 'shipment-dispatch',
name: 'shipment-dispatch',
group: 'shipment-flow',
description: 'Dispatches shipment to carrier after order confirmation',
execCount: 387,
successRate: 98.4,
avgDurationMs: 118,
p99DurationMs: 248,
status: 'healthy',
processors: ['from(jms:shipments)', 'unmarshal(json)', 'enrich(carrier-api)', 'to(carrier-gateway)'],
},
{
id: 'shipment-track',
name: 'shipment-track',
group: 'shipment-flow',
description: 'Polls carrier APIs for shipment status updates and notifies customers',
execCount: 923,
successRate: 99.5,
avgDurationMs: 94,
p99DurationMs: 167,
status: 'healthy',
processors: ['from(jms:tracking)', 'enrich(carrier-api)', 'to(notification-hub)'],
},
{
id: 'notification-dispatch',
name: 'notification-dispatch',
group: 'notification-flow',
description: 'Sends email and SMS notifications to customers for order events',
execCount: 471,
successRate: 98.9,
avgDurationMs: 62,
p99DurationMs: 124,
status: 'healthy',
processors: ['from(jms:notifications)', 'route(by-type)', 'to(smtp)', 'to(sms-gateway)'],
},
]