export function LevelDbCard()

in src/components/graphs/MemorySpecs/storageEngineMetrics.tsx [336:417]


export function LevelDbCard({
  levelDbSize,
  rssSize,
  numReads,
  numWrites,
}: LevelDbCardProps) {
  const size = Math.round(levelDbSize / 1000);

  const memoryMetrics: MemoryMetric[] = [
    // {
    //   name: "Level DB Approx Size",
    //   value: String(size) + " KB",
    //   description: "Estimated size of the LevelDB database",
    //   link: "https://github.com/google/leveldb",
    // },
    {
      name: "RSS",
      value: rssSize ? String(rssSize || 0) + " MB" : 0,
      description: "Current Resident Set Size (physical memory used)",
      link: "https://en.wikipedia.org/wiki/Resident_set_size",
    },
    {
      name: "Number of Reads by process",
      value: numReads,
      description:
        "Number of times the file system had to read from the disk on behalf of processes.",
      link: "https://www.gnu.org/software/libc/manual/html_node/Resource-Usage.html",
    },
    {
      name: "Number of Writes by process",
      value: numWrites,
      description:
        "The number of times the file system had to write to the disk on behalf of processes.",
      link: "https://www.gnu.org/software/libc/manual/html_node/Resource-Usage.html",
    },
  ];

  return (
    <Card className="w-full max-w-2xl">
      <CardHeader>
        <CardTitle>Memory Footprint</CardTitle>
      </CardHeader>
      <CardContent>
        <Table>
          <TableHeader>
            <TableRow>
              <TableHead>Metric</TableHead>
              <TableHead>Value</TableHead>
              <TableHead>Info</TableHead>
            </TableRow>
          </TableHeader>
          <TableBody>
            {memoryMetrics.map((metric) => (
              <TableRow key={metric.name}>
                <TableCell>{metric.name}</TableCell>
                <TableCell>{metric.value || 0}</TableCell>
                <TableCell>
                  <TooltipProvider>
                    <Tooltip>
                      <TooltipTrigger asChild>
                        <Link
                          to={metric.link}
                          target="_blank"
                          rel="noopener noreferrer"
                        >
                          <InfoIcon className="h-4 w-4 text-muted-foreground hover:text-foreground" />
                        </Link>
                      </TooltipTrigger>
                      <TooltipContent>
                        <p>{metric.description}</p>
                      </TooltipContent>
                    </Tooltip>
                  </TooltipProvider>
                </TableCell>
              </TableRow>
            ))}
          </TableBody>
        </Table>
      </CardContent>
    </Card>
  );
}