MCPcopy Create free account
hub / github.com/anus-dev/ANUS / StatRow

Function StatRow

packages/cli/src/ui/components/ToolStatsDisplay.tsx:30–54  ·  view source on GitHub ↗
({ name, stats })

Source from the content-addressed store, hash-verified

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
56export const ToolStatsDisplay: React.FC = () => {
57 const { stats } = useSessionStats();

Callers

nothing calls this directly

Calls 2

getStatusColorFunction · 0.85
formatDurationFunction · 0.85

Tested by

no test coverage detected