Files
nodarium/app/src/lib/worker-runtime-executor-backend.ts
Max Richter e0e1743b77
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m10s
feat: implement performance view
2024-04-25 03:37:52 +02:00

20 lines
708 B
TypeScript

import { MemoryRuntimeExecutor } from "./runtime-executor";
import { RemoteNodeRegistry } from "./node-registry-client";
import type { Graph } from "@nodes/types";
import { createPerformanceStore } from "./performance/store";
const nodeRegistry = new RemoteNodeRegistry("");
const executor = new MemoryRuntimeExecutor(nodeRegistry);
const performanceStore = createPerformanceStore();
executor.perf = performanceStore;
export async function executeGraph(graph: Graph, settings: Record<string, unknown>): Promise<Int32Array> {
await nodeRegistry.load(graph.nodes.map((n) => n.type));
return executor.execute(graph, settings);
}
export function getPerformanceData() {
return performanceStore.get();
}