Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): speed up long thread message sync #17387

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/17387/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 114 additions and 22 deletions (loading 4).

x
0 of 5 viewed, 5 left
114 additions and 22 deletionsapps/server/src/orchestration-v2/ProjectionStore.test.tsModified
View file
@@ -54,6 +54,23 @@
const providerInstanceId = modelSelection.instanceId;
const encodeUnknownJsonString = Schema.encodeSync(Schema.fromJsonString(Schema.Unknown));
​
+const traceSqlStatements = () => {
+ const statements: Array<string> = [];
+ const tracer = Tracer.make({
+ span(options) {
+ const span = new Tracer.NativeSpan(options);
+ const end = span.end.bind(span);
+ span.end = (endTime, exit) => {
+ end(endTime, exit);
+ const query = span.attributes.get("db.query.text");
+ if (typeof query === "string") statements.push(query);
+ };
+ return span;
+ },
+ });
+ return { statements, tracer };
+};
+​
const addRolledBackRecoveryCandidate = Effect.fn("addRolledBackRecoveryCandidate")(function* (
suffix: string,
) {
@@ -590,19 +607,7 @@
});
yield* sql`INSERT INTO orchestration_v2_projection_turn_items ${sql.insert(rows)}`;
- const statements: Array<string> = [];