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

Multi instance #3473

Merged
merged 48 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e66537c
checkpoint
lbwexler Aug 18, 2023
afa3b36
Misc. checkpoint
lbwexler Aug 18, 2023
08d3294
checkpoint
lbwexler Aug 19, 2023
02f4acb
Checkpoint -- minor UI tweaks
lbwexler Aug 21, 2023
3729378
Checkpoint
lbwexler Aug 21, 2023
5dd802c
Remove/simplify comments
lbwexler Aug 21, 2023
615a954
Checkpoint
lbwexler Aug 23, 2023
91b717c
Checkpoint
lbwexler Aug 23, 2023
134194f
Checkpoint
lbwexler Aug 23, 2023
fed63cc
Checkpoint
lbwexler Aug 23, 2023
f67816a
Remove/simplify comments
lbwexler Aug 23, 2023
0378cda
Checkpoint
lbwexler Aug 24, 2023
afda838
Checkpoint -- improve stats
lbwexler Sep 2, 2023
1e79a84
Merge branch 'develop' into multiInstance
lbwexler Sep 2, 2023
fea3a27
Add changelog
lbwexler Sep 2, 2023
1da431e
Multi-instance support for monitors
lbwexler Sep 5, 2023
ef41a92
Tweaks to admin UI
lbwexler Sep 6, 2023
9d6c255
Merge branch 'develop' into multiInstance
lbwexler Sep 6, 2023
af34296
Enable instance shutdown
lbwexler Sep 7, 2023
42963c8
Refactor Error handling in new instance-specific admin
lbwexler Sep 12, 2023
3b9f83b
Column cleanup
lbwexler Sep 12, 2023
e1440e9
WIP to xfer to desktop
amcclain Sep 15, 2023
b467c33
Merge branch 'develop' into multiInstanceAtm
amcclain Sep 15, 2023
b815533
Assorted admin UI updates
amcclain Sep 16, 2023
9b3c7d9
Merge branch 'develop' into multiInstance
amcclain Sep 21, 2023
28f5464
Version to 61.0.0-SNAPSHOT
amcclain Sep 21, 2023
667e203
checkpoint -- support for isReady
lbwexler Sep 29, 2023
9beb358
Show instance name in version bar, and about dialog
lbwexler Oct 1, 2023
5c234b1
Improve support for timestamps handling
lbwexler Oct 2, 2023
258a53a
Tweak to File Display to show/select correct logs
lbwexler Oct 2, 2023
4a0b594
+ Improve Hibernate caching management and fold into `DistributedObje…
lbwexler Oct 12, 2023
a9a6aab
Query Service stats for service on demand
lbwexler Oct 16, 2023
eb5e68d
Merge branch 'develop' into multiInstance
lbwexler Oct 16, 2023
ca079d2
fixes to client-side error handling
lbwexler Oct 18, 2023
527522f
Fixes to special handling for instanceNotfound
lbwexler Oct 18, 2023
5df5339
Update to support notion that server may "swap out" beneath a running…
lbwexler Oct 20, 2023
8706413
Merge branch 'develop' into multiInstance
lbwexler Nov 14, 2023
095d339
Merge branch 'develop' into multiInstance
lbwexler Nov 17, 2023
837d5fb
Checkpoint
lbwexler Nov 20, 2023
06f985a
Improve Timestamp formatting in new cluster tab
lbwexler Nov 22, 2023
3e308b3
Merge branch 'develop' into multiInstance
lbwexler Dec 26, 2023
cc56537
Merge branch 'develop' into multiInstance
lbwexler Mar 17, 2024
3ee3b82
Upgrade snapshot version for multi-instance
lbwexler Mar 18, 2024
4b538e9
Merge branch 'develop' into multiInstance
lbwexler Apr 2, 2024
ad5a327
Merge branch 'develop' into multiInstance
lbwexler Apr 4, 2024
3e30140
Update changelog
lbwexler Apr 4, 2024
0595f61
Merge branch 'develop' into multiInstance
lbwexler Apr 5, 2024
97ef0bb
Merge branch 'develop' into multiInstance
lbwexler Apr 5, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

## 64.0.0-SNAPSHOT - unreleased

### 🎁 New Features
* Provides admin support for Cluster-aware version of Hoist.

### 💥 Breaking Changes
* Requires update to `hoist-core >= 20.0.0`.

## 63.0.1 - 2024-04-05

### 🐞 Bug Fixes

* New filterable fields exposed in the Admin Console for `ActivityTracking` and `ClientErrors` modules.
* `url`, `appEnvironment`, `appVersion` in `ActivityTracking`
* `impersonating` in `ClientErrors`
*

## 63.0.0 - 2024-04-04

Expand Down
41 changes: 21 additions & 20 deletions admin/AppModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {Route} from 'router5';
import {activityTab} from './tabs/activity/ActivityTab';
import {generalTab} from './tabs/general/GeneralTab';
import {monitorTab} from './tabs/monitor/MonitorTab';
import {serverTab} from './tabs/server/ServerTab';
import {clusterTab} from '@xh/hoist/admin/tabs/cluster/ClusterTab';
import {userDataTab} from './tabs/userData/UserDataTab';

export class AppModel extends HoistAppModel {
Expand Down Expand Up @@ -63,11 +63,26 @@ export class AppModel extends HoistAppModel {
children: [
{name: 'about', path: '/about'},
{name: 'config', path: '/config'},
{name: 'logLevels', path: '/logLevels'},
{name: 'users', path: '/users'},
{name: 'roles', path: '/roles'},
{name: 'alertBanner', path: '/alertBanner'}
]
},
{
name: 'cluster',
path: '/cluster',
children: [
{name: 'logs', path: '/logs'},
{name: 'memory', path: '/memory'},
{name: 'jdbcPool', path: '/jdbcPool'},
{name: 'environment', path: '/environment'},
{name: 'services', path: '/services'},
{name: 'objects', path: '/objects'},
{name: 'hibernate', path: '/hibernate'},
{name: 'webSockets', path: '/webSockets'}
]
},
{
name: 'activity',
path: '/activity',
Expand All @@ -77,20 +92,6 @@ export class AppModel extends HoistAppModel {
{name: 'feedback', path: '/feedback'}
]
},
{
name: 'server',
path: '/server',
children: [
{name: 'logViewer', path: '/logViewer'},
{name: 'logLevels', path: '/logLevels'},
{name: 'memory', path: '/memory'},
{name: 'connectionPool', path: '/connectionPool'},
{name: 'environment', path: '/environment'},
{name: 'services', path: '/services'},
{name: 'ehCache', path: '/ehCache'},
{name: 'webSockets', path: '/webSockets'}
]
},
{
name: 'monitor',
path: '/monitor',
Expand Down Expand Up @@ -118,16 +119,16 @@ export class AppModel extends HoistAppModel {
icon: Icon.info(),
content: generalTab
},
{
id: 'cluster',
icon: Icon.server(),
content: clusterTab
},
{
id: 'activity',
icon: Icon.analytics(),
content: activityTab
},
{
id: 'server',
icon: Icon.server(),
content: serverTab
},
{
id: 'monitor',
icon: Icon.shieldCheck(),
Expand Down
9 changes: 8 additions & 1 deletion admin/columns/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*
* Copyright © 2024 Extremely Heavy Industries Inc.
*/
import {ColumnSpec} from '@xh/hoist/cmp/grid';
import {ColumnSpec, dateTimeSec} from '@xh/hoist/cmp/grid';
import {dateTimeRenderer} from '@xh/hoist/format';

export const name: ColumnSpec = {
field: {name: 'name', type: 'string'},
Expand Down Expand Up @@ -39,3 +40,9 @@ export const note: ColumnSpec = {
flex: true,
tooltip: true
};

export const timestampNoYear: ColumnSpec = {
field: {name: 'timestamp', type: 'date'},
...dateTimeSec,
renderer: dateTimeRenderer({fmt: 'MMM DD HH:mm:ss'})
};
56 changes: 56 additions & 0 deletions admin/tabs/cluster/BaseInstanceModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file belongs to Hoist, an application development toolkit
* developed by Extremely Heavy Industries (www.xh.io | [email protected])
*
* Copyright © 2024 Extremely Heavy Industries Inc.
*/
import {ClusterTabModel} from '@xh/hoist/admin/tabs/cluster/ClusterTabModel';
import {HoistModel, LoadSpec, lookup, PlainObject, XH} from '@xh/hoist/core';
import {fmtDateTimeSec, fmtJson} from '@xh/hoist/format';
import {DAYS} from '@xh/hoist/utils/datetime';
import {cloneDeep, forOwn, isArray, isNumber, isPlainObject} from 'lodash';

export class BaseInstanceModel extends HoistModel {
@lookup(() => ClusterTabModel) parent: ClusterTabModel;

get instanceName(): string {
return this.parent.instanceName;
}

fmtStats(stats: PlainObject): string {
stats = cloneDeep(stats);
this.processTimestamps(stats);
return fmtJson(JSON.stringify(stats));
}

handleLoadException(e: unknown, loadSpec: LoadSpec) {
const instanceNotFound = this.isInstanceNotFound(e);
XH.handleException(e, {
showAlert: !loadSpec.isAutoRefresh && !instanceNotFound,
logOnServer: !instanceNotFound
});
}

isInstanceNotFound(e: unknown): boolean {
return e['name'] == 'InstanceNotFoundException';
}

//-------------------
// Implementation
//-------------------
private processTimestamps(stats: PlainObject) {
forOwn(stats, (v, k) => {
// Convert numbers that look like recent timestamps to date values.
if (
(k.endsWith('Time') || k.endsWith('Date') || k == 'timestamp') &&
isNumber(v) &&
v > Date.now() - 365 * DAYS
) {
stats[k] = v ? fmtDateTimeSec(v, {fmt: 'MMM DD HH:mm:ss'}) : null;
}
if (isPlainObject(v) || isArray(v)) {
this.processTimestamps(v);
}
});
}
}
47 changes: 47 additions & 0 deletions admin/tabs/cluster/ClusterTab.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* This file belongs to Hoist, an application development toolkit
* developed by Extremely Heavy Industries (www.xh.io | [email protected])
*
* Copyright © 2024 Extremely Heavy Industries Inc.
*/
import {grid} from '@xh/hoist/cmp/grid';
import {tabContainer} from '@xh/hoist/cmp/tab';
import {creates, hoistCmp} from '@xh/hoist/core';
import {mask} from '@xh/hoist/desktop/cmp/mask';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {tabSwitcher} from '@xh/hoist/desktop/cmp/tab';
import {box, hspacer, placeholder, vframe} from '@xh/hoist/cmp/layout';
import {ClusterTabModel} from './ClusterTabModel';
import {Icon} from '@xh/hoist/icon';

export const clusterTab = hoistCmp.factory({
model: creates(ClusterTabModel),
render({model}) {
const {instance} = model;
return vframe(
panel({
modelConfig: {
side: 'top',
defaultSize: 105,
minSize: 75,
collapsible: false,
persistWith: model.persistWith
},
item: grid()
}),
instance?.isReady
? panel({
compactHeader: true,
tbar: [
box({width: 150, item: model.formatInstance(instance)}),
hspacer(25),
tabSwitcher()
],
flex: 1,
item: tabContainer()
})
: placeholder(Icon.server(), 'Select a running instance above.'),
mask({bind: model.loadModel})
);
}
});
Loading
Loading