UNPKG

axiodb

Version:

The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platfor

29 lines (28 loc) 1.32 kB
import { AxioDB } from "../../Services/Indexation.operation"; export default class StatsController { private AxioDBInstance; constructor(AxioDBInstance: AxioDB); /** * Retrieves dashboard statistics for the AxioDB instance. * * This method gathers and compiles various statistics about the database system: * - Count of databases, collections, and documents * - Storage information (used storage and total machine storage) * - In-memory cache details * * All storage metrics are converted to MB for consistency. * * @returns {Promise<Object>} A formatted response object containing: * - HTTP status code * - Status message * - Data payload with the following statistics: * - totalDatabases: Number of databases in the instance * - totalCollections: Total number of collections across all databases * - totalDocuments: Total number of documents across all collections * - storageInfo: Object containing storage metrics (total used, machine total, and units) * - cacheStorage: Object containing cache storage metrics (current usage, maximum, and units) * * @throws Will return an error response with status 500 if the operation fails */ getDashBoardStat(): Promise<object>; }