@graphql-mesh/plugin-statsd 0.104.3-alpha-20250328130636-eff61089c63c2fe1fde108808e04af557b79224e → 0.104.3
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 +3 -1
- package/esm/index.js +3 -1
- package/package.json +1 -1
- package/typings/index.d.cts +4 -0
- package/typings/index.d.ts +4 -0
package/cjs/index.js
CHANGED
|
@@ -14,7 +14,9 @@ const metricNames = {
|
|
|
14
14
|
fetchLatency: 'fetch.latency',
|
|
15
15
|
};
|
|
16
16
|
function useMeshStatsd(pluginOptions) {
|
|
17
|
-
const client =
|
|
17
|
+
const client = pluginOptions.client && 'close' in pluginOptions.client
|
|
18
|
+
? pluginOptions.client
|
|
19
|
+
: new hot_shots_1.StatsD(pluginOptions.client);
|
|
18
20
|
const prefix = pluginOptions.prefix || 'graphql';
|
|
19
21
|
return {
|
|
20
22
|
onPluginInit({ addPlugin }) {
|
package/esm/index.js
CHANGED
|
@@ -11,7 +11,9 @@ const metricNames = {
|
|
|
11
11
|
fetchLatency: 'fetch.latency',
|
|
12
12
|
};
|
|
13
13
|
export default function useMeshStatsd(pluginOptions) {
|
|
14
|
-
const client =
|
|
14
|
+
const client = pluginOptions.client && 'close' in pluginOptions.client
|
|
15
|
+
? pluginOptions.client
|
|
16
|
+
: new StatsD(pluginOptions.client);
|
|
15
17
|
const prefix = pluginOptions.prefix || 'graphql';
|
|
16
18
|
return {
|
|
17
19
|
onPluginInit({ addPlugin }) {
|
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { StatsD } from 'hot-shots';
|
|
1
2
|
import type { MeshPlugin, YamlConfig } from '@graphql-mesh/types';
|
|
3
|
+
export type StatsDPluginOptions = Omit<YamlConfig.StatsdPlugin, 'client'> & {
|
|
4
|
+
client?: StatsD | YamlConfig.StatsdClientConfiguration;
|
|
5
|
+
};
|
|
2
6
|
export default function useMeshStatsd(pluginOptions: YamlConfig.StatsdPlugin): MeshPlugin<any>;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { StatsD } from 'hot-shots';
|
|
1
2
|
import type { MeshPlugin, YamlConfig } from '@graphql-mesh/types';
|
|
3
|
+
export type StatsDPluginOptions = Omit<YamlConfig.StatsdPlugin, 'client'> & {
|
|
4
|
+
client?: StatsD | YamlConfig.StatsdClientConfiguration;
|
|
5
|
+
};
|
|
2
6
|
export default function useMeshStatsd(pluginOptions: YamlConfig.StatsdPlugin): MeshPlugin<any>;
|