@graphql-mesh/plugin-statsd 0.104.2 → 0.104.3-alpha-20250328130636-eff61089c63c2fe1fde108808e04af557b79224e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +13 -0
- package/esm/index.js +13 -0
- package/package.json +2 -1
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
package/cjs/index.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.default = useMeshStatsd;
|
|
|
4
4
|
const hot_shots_1 = require("hot-shots");
|
|
5
5
|
const statsd_1 = require("@envelop/statsd");
|
|
6
6
|
const utils_1 = require("@graphql-mesh/utils");
|
|
7
|
+
const disposablestack_1 = require("@whatwg-node/disposablestack");
|
|
7
8
|
const metricNames = {
|
|
8
9
|
delegationCount: 'delegations.count',
|
|
9
10
|
delegationErrorCount: 'delegations.error.count',
|
|
@@ -61,5 +62,17 @@ function useMeshStatsd(pluginOptions) {
|
|
|
61
62
|
client.histogram(`${prefix}.${metricNames.delegationLatency}`, end - start, tags);
|
|
62
63
|
};
|
|
63
64
|
},
|
|
65
|
+
[disposablestack_1.DisposableSymbols.asyncDispose]() {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
client.close(err => {
|
|
68
|
+
if (err) {
|
|
69
|
+
reject(err);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
resolve();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
},
|
|
64
77
|
};
|
|
65
78
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StatsD } from 'hot-shots';
|
|
2
2
|
import { useStatsD } from '@envelop/statsd';
|
|
3
3
|
import { getHeadersObj } from '@graphql-mesh/utils';
|
|
4
|
+
import { DisposableSymbols } from '@whatwg-node/disposablestack';
|
|
4
5
|
const metricNames = {
|
|
5
6
|
delegationCount: 'delegations.count',
|
|
6
7
|
delegationErrorCount: 'delegations.error.count',
|
|
@@ -58,5 +59,17 @@ export default function useMeshStatsd(pluginOptions) {
|
|
|
58
59
|
client.histogram(`${prefix}.${metricNames.delegationLatency}`, end - start, tags);
|
|
59
60
|
};
|
|
60
61
|
},
|
|
62
|
+
[DisposableSymbols.asyncDispose]() {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
client.close(err => {
|
|
65
|
+
if (err) {
|
|
66
|
+
reject(err);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
resolve();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
},
|
|
61
74
|
};
|
|
62
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/plugin-statsd",
|
|
3
|
-
"version": "0.104.
|
|
3
|
+
"version": "0.104.3-alpha-20250328130636-eff61089c63c2fe1fde108808e04af557b79224e",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@envelop/statsd": "^6.0.0",
|
|
11
11
|
"@graphql-mesh/types": "^0.104.2",
|
|
12
12
|
"@graphql-mesh/utils": "^0.104.2",
|
|
13
|
+
"@whatwg-node/disposablestack": "^0.0.6",
|
|
13
14
|
"hot-shots": "^10.2.1",
|
|
14
15
|
"tslib": "^2.4.0"
|
|
15
16
|
},
|
package/typings/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MeshPlugin,
|
|
2
|
-
export default function useMeshStatsd(pluginOptions:
|
|
1
|
+
import type { MeshPlugin, YamlConfig } from '@graphql-mesh/types';
|
|
2
|
+
export default function useMeshStatsd(pluginOptions: YamlConfig.StatsdPlugin): MeshPlugin<any>;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MeshPlugin,
|
|
2
|
-
export default function useMeshStatsd(pluginOptions:
|
|
1
|
+
import type { MeshPlugin, YamlConfig } from '@graphql-mesh/types';
|
|
2
|
+
export default function useMeshStatsd(pluginOptions: YamlConfig.StatsdPlugin): MeshPlugin<any>;
|