get_latency_history
Analyze latency trends over time for specific events in Valkey/Redis instances to identify performance patterns and investigate historical behavior.
Instructions
Get the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| eventName | Yes | Latency event name to query | |
| instanceId | No | Optional instance ID override |
Implementation Reference
- packages/mcp/src/index.ts:640-645 (handler)The MCP tool handler for 'get_latency_history'. It fetches the latency history data from the API based on the event name.
async ({ eventName, instanceId }) => { const id = resolveInstanceId(instanceId); const data = await apiFetch(`/mcp/instance/${id}/latency/history/${encodeURIComponent(eventName)}`); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; - packages/mcp/src/index.ts:633-645 (registration)Registration of the 'get_latency_history' MCP tool, including input schema validation.
server.tool( 'get_latency_history', "Get the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.", { eventName: z.string().regex(/^[a-zA-Z0-9_.-]+$/, 'Invalid event name').describe('Latency event name to query'), instanceId: z.string().optional().describe('Optional instance ID override'), }, async ({ eventName, instanceId }) => { const id = resolveInstanceId(instanceId); const data = await apiFetch(`/mcp/instance/${id}/latency/history/${encodeURIComponent(eventName)}`); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], };