From 3096df3d26040b40bce26b3dc4da09916fc85821 Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 3 Dec 2024 16:09:21 +1030 Subject: [PATCH] Update index.ts Co-authored-by: Nadeesha Cabral --- examples/pg-stat-analysis/README.md | 7 ------- examples/pg-stat-analysis/src/index.ts | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/pg-stat-analysis/README.md b/examples/pg-stat-analysis/README.md index d5e8694a..996e2143 100644 --- a/examples/pg-stat-analysis/README.md +++ b/examples/pg-stat-analysis/README.md @@ -10,13 +10,6 @@ `@inferable/pg-stat-analysis` is an analytical agent designed to evaluate and improve the performance of your PostgreSQL database through recommendations based on access patterns. The agent provides suggestions such as creating indexes or other optimization strategies to enhance query performance. It makes use of the `pg_stat_statements` extension to provide data-driven recommendations. -## Features - -- Analyzes PostgreSQL database performance using `pg_stat_statements`. -- Provides suggestions for performance improvements. -- Avoids recommending redundant actions, such as VACUUM suggestions if auto-vacuum is enabled. -- Utilizes type-safety via Zod schema validation. - ## Prerequisites - **Node.js** - Ensure you have Node.js installed. diff --git a/examples/pg-stat-analysis/src/index.ts b/examples/pg-stat-analysis/src/index.ts index e6b9c641..e30fac77 100644 --- a/examples/pg-stat-analysis/src/index.ts +++ b/examples/pg-stat-analysis/src/index.ts @@ -2,7 +2,7 @@ import { readFileSync, writeFileSync, existsSync } from 'fs'; import { Inferable } from 'inferable'; import { z } from 'zod'; -const HISTORY_PATH = './history.json'; +const HISTORY_PATH = path.join(__dirname, 'history.json') if (!existsSync(HISTORY_PATH)) { writeFileSync(HISTORY_PATH, JSON.stringify({ suggestions: [] }));