Skip to content

Commit

Permalink
use relation backpressure
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Sep 17, 2024
1 parent 249b3b4 commit f7dfe8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Start a RisingWave cluster, create some tables and materialized views for testin
For example:

```bash
./risedev d
./risedev d full
./risedev slt e2e_test/nexmark/create_sources.slt.part
./risedev psql -c 'CREATE TABLE dimension (v1 int);'
./risedev psql -c 'CREATE MATERIALIZED VIEW mv AS SELECT auction.* FROM dimension join auction on auction.id-auction.id = dimension.v1;'
Expand Down
24 changes: 17 additions & 7 deletions dashboard/pages/ddl_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ function buildDdlDependencyAsEdges(
for (const relation of relations) {
relation_ids.add(relation.id)
}
console.log("relation_ids: ", relation_ids)
const nodes: DdlBox[] = []
for (const relation of relations) {
let parentIds = relation.dependentRelations
console.log("parentIds: ", parentIds)
nodes.push({
id: relation.id.toString(),
order: relation.id,
Expand Down Expand Up @@ -307,6 +309,8 @@ export default function Streaming() {
if (!fragmentVertexToRelationMap) {
return
}
let inMap = fragmentVertexToRelationMap.inMap
let outMap = fragmentVertexToRelationMap.outMap
console.log("fragmentVertexToRelationMap", fragmentVertexToRelationMap);
if (promethusMetrics || embeddedBackPressureInfo) {
let map = new Map()
Expand All @@ -317,10 +321,17 @@ export default function Streaming() {
embeddedBackPressureInfo.totalDurationNs
)
for (const m of metrics.outputBufferBlockingDuration) {
map.set(
`${m.metric.fragmentId}_${m.metric.downstreamFragmentId}`,
m.sample[0].value
)
let output = m.metric.fragmentId
let input = m.metric.downstreamFragmentId
if (outMap[output] && inMap[input]) {
output = outMap[output]
input = inMap[input]
let key = `${output}_${input}`
map.set(
key,
m.sample[0].value
)
}
}
} else if (backPressureDataSource === "Prometheus" && promethusMetrics) {
for (const m of promethusMetrics.outputBufferBlockingDuration) {
Expand All @@ -339,8 +350,7 @@ export default function Streaming() {
}
}
}
let relation_map = new Map()
// Rekey the map to use relation id instead of fragment id.
console.log("backpressure map: ", map)
return map
}
}, [backPressureDataSource, promethusMetrics, embeddedBackPressureInfo, fragmentVertexToRelationMap])
Expand Down Expand Up @@ -423,7 +433,7 @@ export default function Streaming() {
{ddlDependency && (
<DdlGraph
ddlDependency={ddlDependency}
backPressures={SampleDdlBackpressures}
backPressures={backPressures}
/>
)}
</Box>
Expand Down

0 comments on commit f7dfe8d

Please sign in to comment.