Skip to content

Commit

Permalink
fix :: trace graph
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed Aug 25, 2024
1 parent b57b5c3 commit 4d7aca1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/graph/TraceErrorGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const TraceErrorGraph: React.FC<PlotlyChartProps> = ({ jsonData }) => {
const chartRef = useRef<HTMLDivElement>(null);

useEffect(() => {
if (chartRef.current && jsonData['1']) {
const timestamps = Object.keys(jsonData['1']).map((ts) => ts.substring(11, 16));
const values = Object.values(jsonData['1']).map(Number);
if (chartRef.current && jsonData) {
const timestamps = Object.keys(jsonData).map((ts) => ts.substring(11, 16));
const values = Object.values(jsonData).map(Number);

const trace = {
x: timestamps,
Expand Down
6 changes: 3 additions & 3 deletions src/components/graph/TraceRequestGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const TraceRequestGraph: React.FC<PlotlyChartProps> = ({ jsonData }) => {
const chartRef = useRef<HTMLDivElement>(null);

useEffect(() => {
if (chartRef.current && jsonData['1']) {
const timestamps = Object.keys(jsonData['1']).map((ts) => ts.substring(11, 16));
const values = Object.values(jsonData['1']).map(Number);
if (chartRef.current && jsonData) {
const timestamps = Object.keys(jsonData).map((ts) => ts.substring(11, 16));
const values = Object.values(jsonData).map(Number);

const trace = {
x: timestamps,
Expand Down
15 changes: 8 additions & 7 deletions src/pages/Team/deploy/Container/Traces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ export const TeamDeployContainerTraces = () => {
});

getContainerRequest(deployUUID, env).then((res) => {
setRequest(res.data);
setRequest(res.data['0']);
console.log(res.data['0']);
});

getContainerError(deployUUID, env).then((res) => {
setError(res.data);
setError(res.data['0']);
});

Promise.all([
Expand All @@ -87,11 +88,11 @@ export const TeamDeployContainerTraces = () => {
])
.then(([res99, res95, res90, res75, res50]) => {
setLatency({
99: res99.data[1],
95: res95.data[1],
90: res90.data[1],
75: res75.data[1],
50: res50.data[1],
99: res99.data['0'],
95: res95.data['0'],
90: res90.data['0'],
75: res75.data['0'],
50: res50.data['0'],
});
})
.catch((error) => {
Expand Down

0 comments on commit 4d7aca1

Please sign in to comment.