({ name, stats })
| 28 | name: string; |
| 29 | stats: ToolCallStats; |
| 30 | }> = ({ name, stats }) => { |
| 31 | const successRate = stats.count > 0 ? (stats.success / stats.count) * 100 : 0; |
| 32 | const avgDuration = stats.count > 0 ? stats.durationMs / stats.count : 0; |
| 33 | const successColor = getStatusColor(successRate, { |
| 34 | green: TOOL_SUCCESS_RATE_HIGH, |
| 35 | yellow: TOOL_SUCCESS_RATE_MEDIUM, |
| 36 | }); |
| 37 | |
| 38 | return ( |
| 39 | <Box> |
| 40 | <Box width={TOOL_NAME_COL_WIDTH}> |
| 41 | <Text color={Colors.LightBlue}>{name}</Text> |
| 42 | </Box> |
| 43 | <Box width={CALLS_COL_WIDTH} justifyContent="flex-end"> |
| 44 | <Text>{stats.count}</Text> |
| 45 | </Box> |
| 46 | <Box width={SUCCESS_RATE_COL_WIDTH} justifyContent="flex-end"> |
| 47 | <Text color={successColor}>{successRate.toFixed(1)}%</Text> |
| 48 | </Box> |
| 49 | <Box width={AVG_DURATION_COL_WIDTH} justifyContent="flex-end"> |
| 50 | <Text>{formatDuration(avgDuration)}</Text> |
| 51 | </Box> |
| 52 | </Box> |
| 53 | ); |
| 54 | }; |
| 55 | |
| 56 | export const ToolStatsDisplay: React.FC = () => { |
| 57 | const { stats } = useSessionStats(); |
nothing calls this directly
no test coverage detected