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

@ -54,44 +54,44 @@
$: statsQuery = queryStore({ $: statsQuery = queryStore({
client: client, client: client,
query: gql` query: gql`
query($filters: [JobFilter!]!) { query($filters: [JobFilter!]!) {
stats: jobsStatistics(filter: $filters) { stats: jobsStatistics(filter: $filters) {
totalJobs totalJobs
shortJobs shortJobs
totalWalltime totalWalltime
totalCoreHours totalCoreHours
histDuration { count, value } histDuration { count, value }
histNumNodes { count, value } histNumNodes { count, value }
} }
topUsers: jobsCount(filter: $filters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count } topUsers: jobsCount(filter: $filters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count }
} }
`, `,
variables: { filters } variables: { filters }
}) })
$: footprintsQuery = queryStore({ $: footprintsQuery = queryStore({
client: client, client: client,
query: gql` query: gql`
query($filters: [JobFilter!]!, $metrics: [String!]!) { query($filters: [JobFilter!]!, $metrics: [String!]!) {
footprints: jobsFootprints(filter: $filters, metrics: $metrics) { footprints: jobsFootprints(filter: $filters, metrics: $metrics) {
nodehours, nodehours,
metrics { metric, data } metrics { metric, data }
} }
}`, }`,
variables: { filters, metrics } variables: { filters, metrics }
}) })
$: rooflineQuery = queryStore({ $: rooflineQuery = queryStore({
client: client, client: client,
query: gql` query: gql`
query($filters: [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: $filters, 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: { 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,21 +30,19 @@
); );
const client = getContextClient(); const client = getContextClient();
const query = gql`
query($filters: [JobFilter!]!) {
rows: jobsStatistics(filter: $filters, groupBy: ${type}) {
id
name
totalJobs
totalWalltime
totalCoreHours
}
}`
$: stats = queryStore({ $: stats = queryStore({
client, client: client,
query, query: gql`
variables: { filters }, query($filters: [JobFilter!]!) {
rows: jobsStatistics(filter: $filters, groupBy: ${type}) {
id
name
totalJobs
totalWalltime
totalCoreHours
}
}`,
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,31 +27,33 @@
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
subCluster subCluster
metrics { metrics {
name name
scope scope
metric { metric {
timestep timestep
unit { base, prefix } unit { base, prefix }
series { series {
statistics { min, avg, max } statistics { min, avg, max }
data data
}
} }
} }
} }
}`,
variables: {
cluster: cluster,
metrics: [selectedMetric],
from: from.toISOString(),
to: to.toISOString()
} }
}`,
variables: {
cluster: cluster,
metrics: [selectedMetric],
from: from.toISOString(),
to: to.toISOString()}
}) })
let metricUnits = {} let metricUnits = {}

View File

@ -25,19 +25,20 @@
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) {
totalJobs totalJobs
shortJobs shortJobs
totalWalltime totalWalltime
totalCoreHours totalCoreHours
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 }
}); });
} }