initial commit with example event dispatch

This commit is contained in:
Christoph Kluge 2024-08-08 12:28:36 +02:00
parent c80d3a6958
commit 0afaea9513
3 changed files with 17 additions and 2 deletions

View File

@ -75,7 +75,7 @@
duration, numNodes, numHWThreads, numAcc, duration, numNodes, numHWThreads, numAcc,
SMT, exclusive, partition, subCluster, arrayJobId, SMT, exclusive, partition, subCluster, arrayJobId,
monitoringStatus, state, walltime, monitoringStatus, state, walltime,
tags { id, type, name, scope }, tags { id, type, name },
resources { hostname, hwthreads, accelerators }, resources { hostname, hwthreads, accelerators },
metaData, metaData,
userData { name, email }, userData { name, email },
@ -229,6 +229,11 @@
$initq.data.job.subCluster, $initq.data.job.subCluster,
), ),
})); }));
const loadRes = ({ detail }) => {
console.log(">>> UPPER RES REQUEST", detail)
}
</script> </script>
<Row> <Row>
@ -358,6 +363,7 @@
<Metric <Metric
bind:this={plots[item.metric]} bind:this={plots[item.metric]}
on:load-all={loadAllScopes} on:load-all={loadAllScopes}
on:new-res={loadRes}
job={$initq.data.job} job={$initq.data.job}
metricName={item.metric} metricName={item.metric}
metricUnit={$initq.data.globalMetrics.find((gm) => gm.name == item.metric)?.unit} metricUnit={$initq.data.globalMetrics.find((gm) => gm.name == item.metric)?.unit}

View File

@ -27,7 +27,7 @@
import { import {
init, init,
checkMetricDisabled, checkMetricDisabled,
} from "./utils.js"; } from "./generic/utils.js";
import PlotTable from "./generic/PlotTable.svelte"; import PlotTable from "./generic/PlotTable.svelte";
import MetricPlot from "./generic/plots/MetricPlot.svelte"; import MetricPlot from "./generic/plots/MetricPlot.svelte";
import TimeSelection from "./generic/select/TimeSelection.svelte"; import TimeSelection from "./generic/select/TimeSelection.svelte";

View File

@ -40,11 +40,15 @@
fetching = false, fetching = false,
error = null; error = null;
let selectedScope = minScope(scopes); let selectedScope = minScope(scopes);
let selectedResolution = 60
$: dispatch("new-res", selectedResolution)
let statsPattern = /(.*)-stat$/ let statsPattern = /(.*)-stat$/
let statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null) let statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null)
let selectedScopeIndex let selectedScopeIndex
const resolutions = [60, 240, 600]
$: availableScopes = scopes; $: availableScopes = scopes;
$: patternMatches = statsPattern.exec(selectedScope) $: patternMatches = statsPattern.exec(selectedScope)
$: if (!patternMatches) { $: if (!patternMatches) {
@ -83,6 +87,11 @@
{/each} {/each}
</select> </select>
{/if} {/if}
<select class="form-select" bind:value={selectedResolution}>
{#each resolutions as res}
<option value={res}>Timestep: {res}</option>
{/each}
</select>
</InputGroup> </InputGroup>
{#key series} {#key series}
{#if fetching == true} {#if fetching == true}