Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves sockets into the advanced worker #7760

Merged
37 commits merged into from Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c356453
Moves sockets into the advanced worker
Dec 19, 2022
dc53df3
worker can die peacefully now, making switching between cluster work.
Jan 5, 2023
03f6d39
Make waitFor generic, wire in to waitForTestFn
richard-cox Jan 6, 2023
4cf1aad
General Changes
richard-cox Jan 6, 2023
07cc083
Switch socket fixes
richard-cox Jan 6, 2023
197834b
Fix socket id for cluster workers
richard-cox Jan 6, 2023
3a13a0e
Fix handling of new partical counts response
richard-cox Jan 6, 2023
4300c85
Make resourceWatcher the sole location for watch state
richard-cox Jan 6, 2023
0fdb22a
pushes the csrf value into worker and adds it to fetch request headers.
Jan 9, 2023
126d649
refactors batchChanges to address ref concerns and be more performant
Jan 9, 2023
6b05898
Maintain schema reference whilst updating
richard-cox Jan 9, 2023
2baa946
Fix waitForTestFn
richard-cox Jan 9, 2023
87c3737
On unwatch ensure any pending watch requests are removed from the queue
richard-cox Jan 9, 2023
e91df45
Fix navigation from cluster manager world to any cluster
richard-cox Jan 9, 2023
316e09e
Tidy some TODOs
richard-cox Jan 9, 2023
8a6f0d8
Add perf settings page
richard-cox Jan 9, 2023
105023b
FIX - Nav from cluster dashboard --> specific event --> cluster dashb…
richard-cox Jan 9, 2023
0c6de44
Tidying up some TODOs
richard-cox Jan 9, 2023
92f7c33
Adds in a cache and uses it to validate SCHEMA messages before batching.
Jan 10, 2023
d6193fd
Forgot to actually save CSRF to the resourceWatcher when instantiated.
Jan 10, 2023
b6cddef
an empty resource in a batchChange to signal remove
Jan 10, 2023
f1cb07d
Move addSchemaIndexFields to and created removeSchemaIndexFields in n…
richard-cox Jan 10, 2023
4f312e2
Fix disconnect/reconnect
richard-cox Jan 10, 2023
8a284f1
Tidying up some TODO's
richard-cox Jan 10, 2023
3cd4ae1
batchChanges will now handle aliases
Jan 11, 2023
b06c7dd
Fix pods list - WIP
richard-cox Jan 11, 2023
709b422
Fix pods list - fixes
richard-cox Jan 11, 2023
f0fdc79
Tidying TODOs
richard-cox Jan 11, 2023
dea67b9
Remove default same-origin header
richard-cox Jan 11, 2023
6a99b33
Fixed TODO description
richard-cox Jan 11, 2023
ac0a1a5
Merge remote-tracking branch 'upstream/master' into feature/sockets_i…
richard-cox Jan 11, 2023
560751d
Refactor subscribe, make it clear which vuex feature relates to what
richard-cox Jan 11, 2023
a1fd6f5
Lots of Fixes
richard-cox Jan 12, 2023
e06c459
Multiple improvements/fixes
richard-cox Jan 13, 2023
2d5687d
toggle debug, remap alias types, cleaned up comments and console
Jan 13, 2023
283ccc8
Unit tests for batchChanges
richard-cox Jan 13, 2023
901fc8f
Logging tweaks
richard-cox Jan 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6785,6 +6785,10 @@ performance:
count:
inputLabel: Resource Threshold
description: The threshold above which filtering by a namespace is required
advancedWorker:
label: Websocket Web Worker
description: Updates to resources pushed to the UI come via WebSocket and are handled in the UI thread. Enable this option to handle cluster WebSocket updates in a Web Worker in a separate thread. This should help the responsiveness of the UI in systems where resources change often.
checkboxLabel: Enable Advanced Websocket Web Worker

banner:
label: Fixed Banners
Expand Down
3 changes: 2 additions & 1 deletion shell/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,6 @@ export const DEFAULT_PERF_SETTING = {
forceNsFilter: {
enabled: false,
threshold: 1500,
}
},
advancedWorker: { enabled: false },
};
11 changes: 2 additions & 9 deletions shell/detail/service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Tab from '@shell/components/Tabbed/Tab';
import { CATTLE_PUBLIC_ENDPOINTS } from '@shell/config/labels-annotations';
import { KEY, VALUE } from '@shell/config/table-headers';
import { POD } from '@shell/config/types';
import { allHash } from '@shell/utils/promise';
import { findBy } from '@shell/utils/array';

export default {
Expand All @@ -36,13 +35,7 @@ export default {
},

async fetch() {
const hash = { pods: this.value.pods() };

const res = await allHash(hash);

for (const k in res) {
this[k] = res[k];
}
await this.value.fetchPods();
},

data() {
Expand Down Expand Up @@ -159,7 +152,7 @@ export default {
:weight="4"
>
<ResourceTable
:rows="pods"
:rows="value.pods"
:headers="podTableHeaders"
key-field="id"
:table-actions="false"
Expand Down
27 changes: 14 additions & 13 deletions shell/models/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,24 @@ export default class extends SteveModel {
return out;
}

get pods() {
get podRelationship() {
const { metadata:{ relationships = [] } } = this;

return async() => {
const podRelationship = (relationships || []).filter(relationship => relationship.toType === POD)[0];
let pods = [];
return (relationships || []).filter(relationship => relationship.toType === POD)[0];
}

if (podRelationship) {
pods = await this.$dispatch('cluster/findMatching', {
type: POD,
selector: podRelationship.selector,
namespace: this.namespace
}, { root: true });
}
async fetchPods() {
if (this.podRelationship) {
await this.$dispatch('cluster/findMatching', {
type: POD,
selector: this.podRelationship.selector,
namespace: this.namespace
}, { root: true });
}
}

return pods;
};
get pods() {
return this.podRelationship ? this.$getters.matching( POD, this.podRelationship.selector, this.namespace ) : [];
}

get serviceType() {
Expand Down
16 changes: 16 additions & 0 deletions shell/pages/c/_cluster/settings/performance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ export default {
/>
</div>
</div>
<!-- Advanced Websocket Worker -->
<div class="mt-40">
<h2>{{ t('performance.advancedWorker.label') }}</h2>
<p>{{ t('performance.advancedWorker.description') }}</p>
<Banner
color="error"
label-key="performance.experimental"
/>
<Checkbox
v-model="value.advancedWorker.enabled"
:mode="mode"
:label="t('performance.advancedWorker.checkboxLabel')"
class="mt-10 mb-20"
:primary="true"
/>
</div>
</div>
</div>
<template v-for="err in errors">
Expand Down
Loading