Adapt analysis and list to new urql version

- plotSelection.svelte not yet working
This commit is contained in:
Christoph Kluge 2023-05-09 15:01:56 +02:00
parent a1ef7c6416
commit 280d63a852
2 changed files with 32 additions and 40 deletions

View File

@ -30,6 +30,7 @@
let rooflineMaxY let rooflineMaxY
let colWidth let colWidth
let numBins = 50 let numBins = 50
let maxY = -1
const ccconfig = getContext('cc-config') const ccconfig = getContext('cc-config')
const metricConfig = getContext('metrics') const metricConfig = getContext('metrics')
@ -44,17 +45,17 @@
console.assert(cluster != null, `This cluster could not be found: ${filterPresets.cluster}`) console.assert(cluster != null, `This cluster could not be found: ${filterPresets.cluster}`)
rooflineMaxY = cluster.subClusters.reduce((max, part) => Math.max(max, part.flopRateSimd.value), 0) rooflineMaxY = cluster.subClusters.reduce((max, part) => Math.max(max, part.flopRateSimd.value), 0)
$rooflineQuery.variables.maxY = rooflineMaxY maxY = rooflineMaxY
$rooflineQuery.context.pause = false
$rooflineQuery.reexecute()
} }
}) })
const statsQuery = queryStore({ const client = getContextClient();
client: getContextClient(),
$: statsQuery = queryStore({
client: client,
query: gql` query: gql`
query($filter: [JobFilter!]!) { query($filters: [JobFilter!]!) {
stats: jobsStatistics(filter: $filter) { stats: jobsStatistics(filter: $filters) {
totalJobs totalJobs
shortJobs shortJobs
totalWalltime totalWalltime
@ -63,38 +64,34 @@
histNumNodes { count, value } histNumNodes { count, value }
} }
topUsers: jobsCount(filter: $filter, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count } topUsers: jobsCount(filter: $filters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count }
} }
`, `,
variables: { filter: [] }, variables: { filters }
pause: true
}) })
const footprintsQuery = queryStore({ $: footprintsQuery = queryStore({
client: getContextClient(), client: client,
query: gql` query: gql`
query($filter: [JobFilter!]!, $metrics: [String!]!) { query($filters: [JobFilter!]!, $metrics: [String!]!) {
footprints: jobsFootprints(filter: $filter, metrics: $metrics) { footprints: jobsFootprints(filter: $filters, metrics: $metrics) {
nodehours, nodehours,
metrics { metric, data } metrics { metric, data }
} }
}`, }`,
variables: { filter: [], metrics }, variables: { filters, metrics }
pause: true
}) })
$: $footprintsQuery.variables = { ...$footprintsQuery.variables, metrics }
const rooflineQuery = queryStore({ $: rooflineQuery = queryStore({
client: getContextClient(), client: client,
query: gql` query: gql`
query($filter: [JobFilter!]!, $rows: Int!, $cols: Int!, query($filters: [JobFilter!]!, $rows: Int!, $cols: Int!,
$minX: Float!, $minY: Float!, $maxX: Float!, $maxY: Float!) { $minX: Float!, $minY: Float!, $maxX: Float!, $maxY: Float!) {
rooflineHeatmap(filter: $filter, rows: $rows, cols: $cols, rooflineHeatmap(filter: $filters, rows: $rows, cols: $cols,
minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY) minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY)
} }
`, `,
variables: { filter: [], rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY: -1. }, variables: { filters, rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY },
pause: true
}) })
onMount(() => filters.update()) onMount(() => filters.update())
@ -123,11 +120,7 @@
disableClusterSelection={true} disableClusterSelection={true}
startTimeQuickSelect={true} startTimeQuickSelect={true}
on:update={({ detail }) => { on:update={({ detail }) => {
$statsQuery.context.pause = false filters = detail.filters;
$statsQuery.variables = { filter: detail.filters }
$footprintsQuery.context.pause = false
$footprintsQuery.variables = { metrics, filter: detail.filters }
$rooflineQuery.variables = { ...$rooflineQuery.variables, filter: detail.filters }
}} /> }} />
</Col> </Col>
</Row> </Row>

View File

@ -29,22 +29,22 @@
"Invalid list type provided!" "Invalid list type provided!"
); );
let filter = []; const client = getContextClient();
const query = gql`
const stats = queryStore({ query($filters: [JobFilter!]!) {
client: getContextClient(), rows: jobsStatistics(filter: $filters, groupBy: ${type}) {
query: gql`
query($filter: [JobFilter!]!) {
rows: jobsStatistics(filter: $filter, groupBy: ${type}) {
id id
name name
totalJobs totalJobs
totalWalltime totalWalltime
totalCoreHours totalCoreHours
} }
}`, }`
variables: { filter },
pause: true, $: stats = queryStore({
client,
query,
variables: { filters },
}); });
let filters; let filters;
@ -100,8 +100,7 @@
startTimeQuickSelect={true} startTimeQuickSelect={true}
menuText="Only {type.toLowerCase()}s with jobs that match the filters will show up" menuText="Only {type.toLowerCase()}s with jobs that match the filters will show up"
on:update={({ detail }) => { on:update={({ detail }) => {
filter = detail.filters; filters = detail.filters;
stats.resume();
}} }}
/> />
</Col> </Col>