metrics on dashboard
This commit is contained in:
@@ -178,13 +178,14 @@ describe("MetricsCollector", () => {
|
||||
});
|
||||
|
||||
test("history is capped at maxHistoryPoints", () => {
|
||||
for (let i = 0; i < 4500; i++) {
|
||||
const weekOfFiveSecondSamples = 7 * 24 * 60 * 12;
|
||||
for (let i = 0; i < weekOfFiveSecondSamples + 180; i++) {
|
||||
const snap = metrics.getSnapshot();
|
||||
metrics.recordHistoryEntry(snap);
|
||||
}
|
||||
|
||||
const history = metrics.getHistory();
|
||||
expect(history.length).toBeLessThanOrEqual(4320);
|
||||
expect(history.length).toBeLessThanOrEqual(weekOfFiveSecondSamples);
|
||||
});
|
||||
|
||||
test("getHistory returns a copy", () => {
|
||||
|
||||
@@ -94,7 +94,7 @@ class MetricsCollector {
|
||||
private receivedPerSecond: number = 0;
|
||||
|
||||
private history: MetricsHistory[] = [];
|
||||
private maxHistoryPoints: number = 4320;
|
||||
private maxHistoryPoints: number = 7 * 24 * 60 * 12;
|
||||
private snapshotEnricher: ((snapshot: MetricsSnapshot) => void) | null = null;
|
||||
|
||||
private pingValues: number[] = [];
|
||||
|
||||
Reference in New Issue
Block a user