Skip to content

Commit

Permalink
fix: remove produce syntax from spans stream to drastically improve p…
Browse files Browse the repository at this point in the history
…erformance at 5k + entries / move number of logs to the left of the filter
  • Loading branch information
johann-crabnebula committed Feb 8, 2024
1 parent 3eb0abc commit 529361e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 4 additions & 7 deletions clients/web/src/lib/connection/transport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InstrumentClient } from "~/lib/proto/instrument.client";
import { TauriClient } from "~/lib/proto/tauri.client";
import { SourcesClient } from "~/lib/proto/sources.client.ts";
import { MetadataClient } from "../proto/meta.client";
import { SetStoreFunction, createStore, produce } from "solid-js/store";
import { SetStoreFunction, createStore } from "solid-js/store";
import {
HealthCheckRequest,
HealthCheckResponse_ServingStatus,
Expand Down Expand Up @@ -115,12 +115,9 @@ export function addStreamListneners(

const spansUpdate = update.spansUpdate;
if (spansUpdate && spansUpdate.spanEvents.length > 0) {
setMonitorData(
"spans",
produce((clonedSpans) =>
updatedSpans(clonedSpans, spansUpdate.spanEvents)
)
);
setMonitorData("spans", (spans) => [
...updatedSpans(spans, spansUpdate.spanEvents),
]);
}
});
}
1 change: 1 addition & 0 deletions clients/web/src/views/dashboard/console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function Console() {
return (
<>
<Toolbar>
<div>({filteredLogs().length})</div>
<input
value={filter.textContent}
onInput={(e) =>
Expand Down

0 comments on commit 529361e

Please sign in to comment.