Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
yufansong committed Jan 30, 2024
1 parent 26af576 commit 527baeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions dashboard/pages/api/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*
*/
import { Metrics, MetricsSample } from "../../components/metrics"
import { Field } from "../../proto/gen/plan_common"
import api from "./api"

export interface BackPressuresMetrics {
Expand Down Expand Up @@ -43,17 +42,15 @@ export const BackPressureInfo = {
actorId: isSet(object.actorId) ? Number(object.actorId) : 0,
fragmentId: isSet(object.fragmentId) ? Number(object.fragmentId) : 0,
downstreamFragmentId: isSet(object.downstreamFragmentId) ? Number(object.downstreamFragmentId) : 0,
value: isSet(object.value) ? Number(object.value) : "0",
value: isSet(object.value) ? Number(object.value) : 0,
}
},
}

// Get back pressure from meta node -> compute node
export async function getComputeBackPressures() {
const response = await api.get("/metrics/back_pressures");

let back_pressure_infos: BackPressureInfo[] = response.backPressureInfos.map(BackPressureInfo.fromJSON)

back_pressure_infos = back_pressure_infos.sort((a, b) => a.actorId - b.actorId)
return back_pressure_infos
}
Expand Down Expand Up @@ -82,4 +79,4 @@ export function p99(samples: MetricsSample[]) {

function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
}
2 changes: 1 addition & 1 deletion dashboard/pages/back_pressure_rates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ export default function back_pressure() {
{table}
</Fragment>
)
}
}

0 comments on commit 527baeb

Please sign in to comment.