Format cleanup

This commit is contained in:
Christoph Kluge 2023-05-12 11:19:37 +02:00
parent 23e485afce
commit 96e4448505
6 changed files with 80 additions and 78 deletions

View File

@ -91,7 +91,7 @@
minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY) minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY)
} }
`, `,
variables: { filters, rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY }, variables: { filters, rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY }
}) })
onMount(() => filters.update()) onMount(() => filters.update())

View File

@ -30,7 +30,9 @@
); );
const client = getContextClient(); const client = getContextClient();
const query = gql` $: stats = queryStore({
client: client,
query: gql`
query($filters: [JobFilter!]!) { query($filters: [JobFilter!]!) {
rows: jobsStatistics(filter: $filters, groupBy: ${type}) { rows: jobsStatistics(filter: $filters, groupBy: ${type}) {
id id
@ -39,12 +41,8 @@
totalWalltime totalWalltime
totalCoreHours totalCoreHours
} }
}` }`,
variables: { filters }
$: stats = queryStore({
client,
query,
variables: { filters },
}); });
let filters; let filters;

View File

@ -13,8 +13,9 @@
let plotWidths = [], colWidth1 = 0, colWidth2 let plotWidths = [], colWidth1 = 0, colWidth2
let from = new Date(Date.now() - 5 * 60 * 1000), to = new Date(Date.now()) let from = new Date(Date.now() - 5 * 60 * 1000), to = new Date(Date.now())
const client = getContextClient();
$: mainQuery = queryStore({ $: mainQuery = queryStore({
client: getContextClient(), client: client,
query: gql`query($cluster: String!, $filter: [JobFilter!]!, $metrics: [String!], $from: Time!, $to: Time!) { query: gql`query($cluster: String!, $filter: [JobFilter!]!, $metrics: [String!], $from: Time!, $to: Time!) {
nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) { nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) {
host host

View File

@ -27,8 +27,9 @@
let hostnameFilter = '' let hostnameFilter = ''
let selectedMetric = ccconfig.system_view_selectedMetric let selectedMetric = ccconfig.system_view_selectedMetric
const client = getContextClient();
$: nodesQuery = queryStore({ $: nodesQuery = queryStore({
client: getContextClient(), client: client,
query: gql`query($cluster: String!, $metrics: [String!], $from: Time!, $to: Time!) { query: gql`query($cluster: String!, $metrics: [String!], $from: Time!, $to: Time!) {
nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) { nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) {
host host
@ -51,7 +52,8 @@
cluster: cluster, cluster: cluster,
metrics: [selectedMetric], metrics: [selectedMetric],
from: from.toISOString(), from: from.toISOString(),
to: to.toISOString()} to: to.toISOString()
}
}) })
let metricUnits = {} let metricUnits = {}

View File

@ -25,8 +25,9 @@
let w1, w2, histogramHeight = 250 let w1, w2, histogramHeight = 250
let selectedCluster = filterPresets?.cluster ? filterPresets.cluster : null let selectedCluster = filterPresets?.cluster ? filterPresets.cluster : null
const client = getContextClient();
$: stats = queryStore({ $: stats = queryStore({
client: getContextClient(), client: client,
query: gql` query: gql`
query($filters: [JobFilter!]!) { query($filters: [JobFilter!]!) {
jobsStatistics(filter: $filters) { jobsStatistics(filter: $filters) {
@ -37,7 +38,7 @@
histDuration { count, value } histDuration { count, value }
histNumNodes { count, value } histNumNodes { count, value }
}}`, }}`,
variables: { filters }, variables: { filters }
}) })
$: selectedCluster = filters[0]?.cluster ? filters[0].cluster.eq : null $: selectedCluster = filters[0]?.cluster ? filters[0].cluster.eq : null

View File

@ -59,16 +59,16 @@
`; `;
$: metricsQuery = queryStore({ $: metricsQuery = queryStore({
client, client: client,
query, query: query,
variables: { id, metrics, scopes }, variables: { id, metrics, scopes }
}); });
function refresh() { function refresh() {
queryStore({ queryStore({
client, client: client,
query, query: query,
variables: { id, metrics, scopes }, variables: { id, metrics, scopes }
}); });
} }