export function CacheHitRatio()

in src/components/graphs/MemorySpecs/storageEngineMetrics.tsx [267:286]


export function CacheHitRatio({ ratio }: CacheHitRatioProps) {
  const percentage = Math.round(ratio * 100);
  return (
    <Card className="w-full max-w-md flex-1">
      <CardHeader>
        <CardTitle>Cache Hit Ratio</CardTitle>
      </CardHeader>
      <CardContent>
        <div className="flex items-center justify-between mb-2">
          <span className="text-sm font-medium">Hit Rate</span>
          <span className="text-2xl font-bold">{percentage || 0}%</span>
        </div>
        <Progress value={percentage || 0} className="h-2" />
        <p className="mt-2 text-sm text-muted-foreground">
          {percentage || 0}% of requests are served from the LRU cache.
        </p>
      </CardContent>
    </Card>
  );
}