Skip to content

Commit

Permalink
adds dbm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arosenkranz committed Jan 8, 2024
1 parent 7f34d07 commit d1a8111
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions services/dbm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# DBM service

## Description

This service is used for our database monitoring courses, built with Python that uses the SQLAlchemy ORM to connect to a Postgres database. When the service is started, the library Faker is used to generate fake data for the database and in our labs we run a few queries in the background to simulate a load on the database.

> TODO: Add queries from labs to this repo
There is also a user-facing component to this service, which can be seen in the `frontend` service with a specific flag thrown in the `featureFlags.config.json` file. Turning it on will result in a product ticker being displayed in the navbar of the application.

## Database schema

The database schema can be found in the `models.py` file with these models:

### items

| Column | Type | Description |
| --- | --- | --- |
| id | Integer | Primary key |
| description | String | Description of the item |
| order_count | String | Number of times the item has been ordered |
| last_hour_order_count | String | Number of times the item has been ordered in the last hour |
| image_url | String | URL to an image of the item |

### preorder_items

| Column | Type | Description |
| --- | --- | --- |
| id | Integer | Primary key |
| description | String | Description of the item |
| order_count | String | Number of times the item has been ordered |
| last_hour | String | Number of times the item has been ordered in the last hour |
| image_url | String | URL to an image of the item |
| is_preorder | Boolean | Whether or not the item is a preorder item |
4 changes: 2 additions & 2 deletions services/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The service is based off of the [Next.js commerce template](https://github.com/v
**Configuration**
The frontend service is configured to use the [Datadog RUM](https://docs.datadoghq.com/real_user_monitoring/) agent. The agent is configured in the `_app.tsx` file.

TODO: Update RUM version in repo
TODO: Update RUM version in repo and add otel (https://docs.datadoghq.com/real_user_monitoring/connect_rum_and_traces/?tab=browserrum#opentelemetry-support)

**Global Context**
Every session to the application randomly selects a user from a list of users in the `/site/config/user_data.json` file to enrich RUM session data with user information.
Expand All @@ -26,7 +26,7 @@ TODO: Configure logging in API routes (add to repo)

### APM

TODO: Configure APM in API routes (add to repo)
TODO: Configure APM in API routes (add to repo from working lab example)

## Code structure

Expand Down

0 comments on commit d1a8111

Please sign in to comment.