Skip to content

Commit

Permalink
Add metric description tooltip to Analysis Page (#515)
Browse files Browse the repository at this point in the history
* add metric descriptions

* add metric description tooltip in analysis tabs
  • Loading branch information
noelchen90 authored Nov 18, 2022
1 parent 27b03b6 commit a946e04
Showing 1 changed file with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
import { Tabs, Typography } from "antd";
import React, { useEffect, useState } from "react";
import { Tabs, Tooltip, Typography } from "antd";
import { QuestionCircleOutlined } from "@ant-design/icons";
import { backendClient } from "../../../../clients";
import { AnalysisPanel } from "../AnalysisPanel";
import { MetricPane } from "./MetricPane";
import { SystemModel } from "../../../../models";
Expand Down Expand Up @@ -33,6 +35,17 @@ export function FineGrainedAnalysis({
metricToSystemAnalysesParsed,
addChartFile,
}: Props) {
const [metricDescriptions, setMetricDescriptions] = useState<{
[key: string]: string;
}>({});

useEffect(() => {
async function fetchMetricDescriptions() {
setMetricDescriptions(await backendClient.metricDescriptionsGet());
}
fetchMetricDescriptions();
}, []);

return (
<AnalysisPanel title="Fine-grained Performance">
<Typography.Paragraph>
Expand All @@ -41,7 +54,17 @@ export function FineGrainedAnalysis({
</Typography.Paragraph>
<Tabs activeKey={activeMetric} onChange={onActiveMetricChange}>
{metricNames.map((metric) => (
<Tabs.TabPane tab={metric} key={metric}>
<Tabs.TabPane
key={metric}
tab={
<span>
{metric}&nbsp;
<Tooltip title={metricDescriptions[metric]}>
<QuestionCircleOutlined style={{ color: "gray" }} />
</Tooltip>
</span>
}
>
<MetricPane
task={task}
systems={systems}
Expand Down

0 comments on commit a946e04

Please sign in to comment.