Skip to content

Commit

Permalink
Descibe monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeniyBurmistrov authored Feb 7, 2022
1 parent 4e9d448 commit 42e36a6
Show file tree
Hide file tree
Showing 9 changed files with 937 additions and 13 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: index
title: reSolve Documentation
description: Full stack CQRS, DDD, Event Sourcing framework for Node.js
slug: /index
---

[Introduction](introduction.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/api-handler/resolve-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `resolve` context object exposes the following API:
| `uploader` | Exposes the file upload API. |
| `eventstoreAdapter` | Exposes the [event store adapter API](../event-store-adapter.md). |
| `performanceTracer` | Exposes the performance tracer API. |
| `monitoring` | Exposes the monitoring API. |
| `monitoring` | Exposes the [monitoring API](../monitoring/monitoring.md). |

## Methods

Expand Down
39 changes: 39 additions & 0 deletions docs/api/monitoring/metric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
id: metric
title: Monitoring Metric
---

## Metric Object

A monitoring metric object contains information about a particular metric collected during application execution. Metrics are stored and processed internally by monitoring adapters and can be accessed through a monitoring object's [`getMetrics`](monitoring.md#getmetrics) method:

```js
const metrics = monitoring.getMetrics('default')
```

A metric object has the following structure:

```js
{
metricName, // The name of a metric.
dimensions, // An array of monitoring dimensions.
timestamp, // The time at which the metric was last updated.
values, // An array of the metric's values.
counts, // An array of the metric's counts.
unit, // The name of the measurment unit.
}
```

## Custom Metric Object

A custom metric object is used to pass metric data to the `metrics.custom()` method. This object has the following structure:

```js
{
metricName, // The name of a metric.
dimensions, // An array of monitoring dimensions.
value, // The metric's values.
count, // The metric's count.
unit, // The name of the measurment unit.
}
```
Loading

0 comments on commit 42e36a6

Please sign in to comment.