doc: update and generate docs

This commit is contained in:
KernelDeimos 2024-12-05 13:29:10 -05:00
parent 3df5f649a4
commit 7424fd888d
2 changed files with 71 additions and 0 deletions

View File

@ -121,6 +121,13 @@ class ExpectationService extends BaseService {
// this.expectations_ = this.expectations_.filter(v => v !== null); // this.expectations_ = this.expectations_.filter(v => v !== null);
} }
/**
* Registers an expectation to be tracked by the service.
*
* @param {Object} workUnit - The work unit to track
* @param {string} checkpoint - The checkpoint to expect
* @returns {void}
*/
expect_eventually ({ workUnit, checkpoint }) { expect_eventually ({ workUnit, checkpoint }) {
this.expectations_.push(new this.expect.CheckpointExpectation(workUnit, checkpoint)); this.expectations_.push(new this.expect.CheckpointExpectation(workUnit, checkpoint));
} }

View File

@ -77,6 +77,28 @@ the source of the error.
- **location:** The location where the error occurred. - **location:** The location where the error occurred.
- **fields:** The error details to report. - **fields:** The error details to report.
### ExpectationService
#### Listeners
##### `boot.consolidation`
ExpectationService registers its commands at the consolidation phase because
the '_init' method of CommandService may not have been called yet.
#### Methods
##### `expect_eventually`
Registers an expectation to be tracked by the service.
###### Parameters
- **workUnit:** The work unit to track
- **checkpoint:** The checkpoint to expect
### LogService ### LogService
The `LogService` class extends `BaseService` and is responsible for managing and The `LogService` class extends `BaseService` and is responsible for managing and
@ -122,8 +144,47 @@ Generates a sanitized file path for log files.
Get the most recent log entries from the buffer maintained by the LogService. Get the most recent log entries from the buffer maintained by the LogService.
By default, the buffer contains the last 20 log entries. By default, the buffer contains the last 20 log entries.
### PagerService
#### Listeners
##### `boot.consolidation`
PagerService registers its commands at the consolidation phase because
the '_init' method of CommandService may not have been called yet.
#### Methods
##### `onInit`
Initializes PagerDuty configuration and registers alert handlers.
If PagerDuty is enabled in the configuration, it sets up an alert handler
to send alerts to PagerDuty.
##### `alert`
Sends an alert to all registered alert handlers.
This method iterates through all alert handlers and attempts to send the alert.
If any handler fails to send the alert, an error message is logged.
###### Parameters
- **alert:** The alert object containing details about the alert.
### ProcessEventService
Service class that handles process-wide events and errors.
Provides centralized error handling for uncaught exceptions and unhandled promise rejections.
Sets up event listeners on the process object to capture and report critical errors
through the logging and error reporting services.
## Libraries ## Libraries
### core.expect
### core.util.identutil ### core.util.identutil
#### Functions #### Functions
@ -201,5 +262,8 @@ extension.
- `../../services/BaseService.js` - `../../services/BaseService.js`
- `../../util/context.js` - `../../util/context.js`
- `../../services/BaseService` (use.BaseService) - `../../services/BaseService` (use.BaseService)
- `../../services/BaseService` (use.BaseService)
- `../../util/context` - `../../util/context`
- `../../services/BaseService` (use.BaseService) - `../../services/BaseService` (use.BaseService)
- `../../services/BaseService` (use.BaseService)
- `../../services/BaseService` (use.BaseService)