Archive update v0.55.2

This commit is contained in:
Eliot Partridge
2019-10-04 10:23:00 -05:00
parent a9bbd552a3
commit 1971e2c962
25 changed files with 407 additions and 106 deletions
@@ -12,9 +12,9 @@ ng-template(#duplicatesPopover)
button.btn.btn-sm.btn-default.ml-1((click)="cleanupDeleted()" title="Cleanup deleted events")
fa-icon.mr-1([icon]="syncIcon" size="lg")
| clear
button.btn.btn-sm.btn-default.ml-1((click)="removeEvents(1000 * 60 * 10)" title="Delete all older than 10 minutes")
button.btn.btn-sm.btn-default.ml-1((click)="removeEvents(1000 * 60 * 60 * 24)" title="Delete all older than 1 day")
fa-icon.mr-1([icon]="clockIcon" size="lg")
| 10min
| 1day
button.btn.btn-sm.btn-default.ml-1((click)="removeEvents(1000 * 3)" title="Delete all events")
fa-icon.mr-1([icon]="trashIcon" size="lg")
| all
@@ -1,18 +1,22 @@
div(style="position: relative;")
div(style="position: absolute; top: -50px; right: 0;")
b.p-2 {{server}}
.btn-group(*ngIf="server")
.btn-group(*ngIf="loaded")
button.btn.btn-default((click)="resetZoom()")
| Reset zoom
button.btn.btn-default((click)="fitZoom()")
| Fit zoom
button.btn.btn-default((click)="fullFrameZoom()")
| Full frame
button.btn.btn-default.ml-1(*ngIf="server" (click)="load(server)")
button.btn.btn-default.ml-1(*ngIf="loaded" (click)="load(server)")
| Refresh
button.btn.btn-default.ml-1(*ngIf="loaded" (click)="disable()")
| Disable
button.btn.btn-default.ml-1(*ngIf="!loaded && server" (click)="enable()")
| Enable
.btn-group.dropdown.ml-1(dropdown)
button.btn.btn-default.dropdown-toggle(dropdownToggle)
| Load
| Select
.dropdown-menu.dropdown-menu-right(*dropdownMenu)
button.dropdown-item(*ngFor="let s of servers" (click)="load(s)")
| {{s}}
@@ -20,11 +24,88 @@ div(style="position: relative;")
div(#container style="position: relative; overflow: hidden;")
canvas(#canvas (mousemove)="mouseMove($event)" (wheel)="wheel($event)" (agDrag)="drag($event)")
div(#tooltip style="display: none; position: absolute; left: 0; top: 0; padding: 2px 6px; background: #111; border-radius: 2px; font-size: 12px; white-space: pre; pointer-events: none;")
p
.float-right.text-muted
div total samples: {{timings.length}}
div samples: {{timings.length}}
br
.float-right.text-muted
div sampling: {{worldPerfStats.isSamplingEnabled}}
br
.float-right.text-muted
div avg update: {{worldPerfStats.avgUpdateTime.toFixed(2)}}
table.table.table-sm(style="font-size: small; width: 1000px;")
br
.float-right.text-muted
div last update: {{worldPerfStats.lastUpdateTime.toFixed(2)}}
br
.float-right.text-muted
div max update: {{worldPerfStats.maxUpdateTime.toFixed(2)}}
br
.float-right.text-muted
div min update: {{worldPerfStats.minUpdateTime.toFixed(2)}}
br
.float-right.text-muted
div moving entities: {{worldPerfStats.movingEntities}}
br
.float-right.text-muted
div controllers: {{worldPerfStats.controllersCount}}
br
.float-right.text-muted
div regions: {{worldPerfStats.regionsCount}}
br
.float-right.text-muted
div maps: {{worldPerfStats.mapsCount}}
br
.float-right.text-muted
div clients: {{worldPerfStats.clients}}
br
.float-right.text-muted
div clients with adds: {{worldPerfStats.clientsWithAdds}}
br
.float-right.text-muted
div clients with updates: {{worldPerfStats.clientsWithUpdates}}
br
.float-right.text-muted
div clients with says: {{worldPerfStats.clientsWithSays}}
br
.float-right.text-muted
div total says: {{worldPerfStats.totalSays}}
br
.float-right.text-muted
div client queue: {{worldPerfStats.clientQueue}}
br
.float-right.text-muted
div client sent: {{(worldPerfStats.sent / 1024).toFixed(2) + 'kb'}}
br
.float-right.text-muted
div client received: {{(worldPerfStats.received / 1024).toFixed(2) + 'kb'}}
br
.float-right.text-muted
div client sent packets: {{worldPerfStats.sentPackets}}
br
.float-right.text-muted
div client received packets: {{worldPerfStats.receivedPackets}}
table.table.table-sm(style="position: relative; bottom : 410px; font-size: small; width: 1000px;")
thead
tr
th.text-right Self Time
@@ -1,6 +1,6 @@
import { Component, ViewChild, ElementRef } from '@angular/core';
import { AdminModel } from '../../../services/adminModel';
import { TimingEntry, TimingEntryType } from '../../../../common/adminInterfaces';
import { TimingEntry, TimingEntryType, WorldPerfStats, defaultWorldPerfStats } from '../../../../common/adminInterfaces';
import { findById, pointInRect, clamp } from '../../../../common/utils';
import { SERVER_FPS } from '../../../../common/constants';
import { AgDragEvent } from '../../../shared/directives/agDrag';
@@ -39,6 +39,7 @@ export class AdminReportsPerf {
endTime = 0;
listing: ListingEntry[] = [];
timings: TimingEntry[] = [];
worldPerfStats = defaultWorldPerfStats();
private tooltips: Tooltip[] = [];
private startTimeFrom = 0;
private endTimeFrom = 0;
@@ -53,10 +54,23 @@ export class AdminReportsPerf {
}
}, 100);
}
setInterval(this.update, frameTime, this);
}
get servers() {
return this.model.state.gameServers.map(s => s.id);
}
disable() {
this.loaded = false;
this.timings = [];
this.listing = [];
this.model.setTimingEnabled(this.server, false);
this.redraw();
}
async enable() {
this.loaded = true;
await this.load(this.server);
}
async load(server: string) {
this.server = server;
this.timings = [];
@@ -72,6 +86,17 @@ export class AdminReportsPerf {
this.redraw();
}
async update(self: AdminReportsPerf) {
if (self.server) {
const result = await self.model.getWorldPerfStats(self.server);
if (result) {
self.worldPerfStats = result as WorldPerfStats;
}
}
else {
self.worldPerfStats = defaultWorldPerfStats();
}
}
mouseMove(e: MouseEvent) {
const rect = this.container.nativeElement.getBoundingClientRect() as DOMRect;
const x = e.pageX - rect.left;
@@ -117,6 +142,10 @@ export class AdminReportsPerf {
}
}
resetZoom() {
if (!this.timings.length) {
return;
}
const firstTime = this.timings[0].time;
const lastTime = this.timings[this.timings.length - 1].time;
this.startTime = firstTime - timePadding;
@@ -125,6 +154,10 @@ export class AdminReportsPerf {
this.lastZoom = 0;
}
fitZoom() {
if (!this.timings.length) {
return;
}
const firstTime = this.timings[0].time;
const lastTime = this.timings[this.timings.length - 1].time;
const totalTime = lastTime - firstTime;
@@ -134,6 +167,10 @@ export class AdminReportsPerf {
this.lastZoom = 1;
}
fullFrameZoom() {
if (!this.timings.length) {
return;
}
const firstTime = this.timings[0].time;
const lastTime = firstTime + frameTime;
this.startTime = firstTime - 2;
@@ -245,6 +282,10 @@ export class AdminReportsPerf {
}
}
recalcListing() {
if (!this.timings.length) {
return;
}
interface Entry extends TimingEntry {
excludedTime: number;
}