1.1.62 • Published 6 months ago

barad-dur v1.1.62

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
6 months ago

Barad-dur

Barad-dur is a tool designed for NestJS projects that provides a comprehensive log of queries in the TypeORM ORM.

Features

  • Track which specific APIs and queries are called by a user and in which functions they are executed.
  • Store the average speed of the queries.
  • Track the number of query executions to detect queries that are stuck in loops.
  • Store the average speed of APIs.
  • Track the number of API executions to isolate and scale specific microservices.

Installation

npm i barad-dur

Configuration

To configure Barad-dur, you need to integrate it into your NestJS project as shown below:

@Module({
  imports: [
    ...,
    BaradDurModule.register({
      url: 'redis://YOUR_REDIS_IP',  // redis_url
      password: 'YOUR_REDIS_PASSWORD',   // redis_password
      tracking: {
        socketPort: 9191,
        fetchKeyFromToken: string | (req:express.Request) => string, // 'YOUR_CLAIM_IN_TOKEN'
      }
    }),
    ...
   ],
   ...
})
export class AppModule { }

Redis Dependency

This tool requires Redis to track query timings. The Redis connection is configured using the provided url and password values.

Tracking

Tracking also requires a socket connection. A client listening on the other end will receive the tracking data for the user.

Log Viewer

To display the logs, you'll need a separate application that receives the logs and transforms them into a UI for visualization. You can get such a program from the following repository:

https://gitlab.com/bakhshabadi.javad/analyse-backend

Images

Tracking user Tracking user Api duration Api duration Api counter Api counter Query duration Query duration Query duration Query duration

Simply set up the environment for this project by pointing it to your own project's address and use the same port that was set in the configuration.

Keywords

NestJS, TypeORM, logging, query tracking, Redis, API tracking, microservices, performance monitoring

1.1.62

6 months ago

1.1.59

7 months ago

1.1.58

7 months ago

1.1.56

7 months ago

1.1.55

7 months ago

1.1.54

7 months ago

1.1.57

7 months ago

1.1.52

7 months ago

1.1.49

8 months ago

1.1.48

8 months ago

1.1.50

8 months ago

1.1.29

10 months ago

1.1.28

10 months ago

1.1.30

10 months ago

1.1.34

10 months ago

1.1.33

10 months ago

1.1.32

10 months ago

1.1.31

10 months ago

1.1.38

10 months ago

1.1.16

10 months ago

1.1.37

10 months ago

1.1.36

10 months ago

1.1.35

10 months ago

1.1.19

10 months ago

1.1.18

10 months ago

1.1.39

10 months ago

1.1.17

10 months ago

1.1.41

10 months ago

1.1.40

10 months ago

1.1.45

9 months ago

1.1.23

10 months ago

1.1.44

9 months ago

1.1.22

10 months ago

1.1.43

9 months ago

1.1.21

10 months ago

1.1.42

10 months ago

1.1.20

10 months ago

1.1.27

10 months ago

1.1.47

9 months ago

1.1.25

10 months ago

1.1.46

9 months ago

1.1.24

10 months ago

1.1.15

10 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago