react-render-pulse 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +318 -2
- package/dist/aggregate/aggregator.d.cts +27 -0
- package/dist/aggregate/aggregator.d.ts +28 -0
- package/dist/aggregate/aggregator.d.ts.map +1 -0
- package/dist/aggregate/histogram.d.cts +18 -0
- package/dist/aggregate/histogram.d.ts +19 -0
- package/dist/aggregate/histogram.d.ts.map +1 -0
- package/dist/components/RenderMonitor.d.cts +19 -0
- package/dist/components/RenderMonitor.d.ts +20 -0
- package/dist/components/RenderMonitor.d.ts.map +1 -0
- package/dist/context/device.d.cts +2 -0
- package/dist/context/device.d.ts +3 -0
- package/dist/context/device.d.ts.map +1 -0
- package/dist/context/route.d.cts +7 -0
- package/dist/context/route.d.ts +8 -0
- package/dist/context/route.d.ts.map +1 -0
- package/dist/core.cjs +56 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +2 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +28 -0
- package/dist/core.js.map +1 -0
- package/dist/export/console.d.cts +3 -0
- package/dist/export/console.d.ts +4 -0
- package/dist/export/console.d.ts.map +1 -0
- package/dist/export/otel.d.cts +34 -0
- package/dist/export/otel.d.ts +35 -0
- package/dist/export/otel.d.ts.map +1 -0
- package/dist/hooks/useRenderMonitor.d.cts +9 -0
- package/dist/hooks/useRenderMonitor.d.ts +10 -0
- package/dist/hooks/useRenderMonitor.d.ts.map +1 -0
- package/dist/index.cjs +634 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +602 -0
- package/dist/index.js.map +1 -0
- package/dist/modes/detect.d.cts +16 -0
- package/dist/modes/detect.d.ts +17 -0
- package/dist/modes/detect.d.ts.map +1 -0
- package/dist/observe/longtasks.d.cts +12 -0
- package/dist/observe/longtasks.d.ts +13 -0
- package/dist/observe/longtasks.d.ts.map +1 -0
- package/dist/observe/renderWindows.d.cts +17 -0
- package/dist/observe/renderWindows.d.ts +18 -0
- package/dist/observe/renderWindows.d.ts.map +1 -0
- package/dist/otel.cjs +65 -0
- package/dist/otel.cjs.map +1 -0
- package/dist/otel.d.cts +2 -0
- package/dist/otel.d.ts +3 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +38 -0
- package/dist/otel.js.map +1 -0
- package/dist/runtime/guard.d.cts +7 -0
- package/dist/runtime/guard.d.ts +8 -0
- package/dist/runtime/guard.d.ts.map +1 -0
- package/dist/runtime/initRenderPulse.d.cts +44 -0
- package/dist/runtime/initRenderPulse.d.ts +45 -0
- package/dist/runtime/initRenderPulse.d.ts.map +1 -0
- package/dist/runtime/runtime.d.cts +13 -0
- package/dist/runtime/runtime.d.ts +14 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/useIsomorphicLayoutEffect.d.cts +2 -0
- package/dist/runtime/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/runtime/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/sample/sample.d.cts +7 -0
- package/dist/sample/sample.d.ts +8 -0
- package/dist/sample/sample.d.ts.map +1 -0
- package/dist/transport/payload.d.cts +8 -0
- package/dist/transport/payload.d.ts +9 -0
- package/dist/transport/payload.d.ts.map +1 -0
- package/dist/transport/transport.d.cts +18 -0
- package/dist/transport/transport.d.ts +19 -0
- package/dist/transport/transport.d.ts.map +1 -0
- package/dist/types.d.cts +120 -0
- package/dist/types.d.ts +121 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +128 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/export/console.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,qHAAqH;AACrH,wBAAgB,qBAAqB,IAAI,QAAQ,CA2BhD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Exporter } from "../types.cjs";
|
|
2
|
+
type Attributes = Record<string, string | number | boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* The parts of an OpenTelemetry `Meter` this exporter uses. Structurally
|
|
5
|
+
* compatible with `@opentelemetry/api`'s `Meter`, so there's no dependency on it.
|
|
6
|
+
*/
|
|
7
|
+
export interface OtelMeterLike {
|
|
8
|
+
createHistogram: (name: string, options?: {
|
|
9
|
+
description?: string;
|
|
10
|
+
unit?: string;
|
|
11
|
+
}) => {
|
|
12
|
+
record: (value: number, attributes?: Attributes) => void;
|
|
13
|
+
};
|
|
14
|
+
createCounter: (name: string, options?: {
|
|
15
|
+
description?: string;
|
|
16
|
+
unit?: string;
|
|
17
|
+
}) => {
|
|
18
|
+
add: (value: number, attributes?: Attributes) => void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface OtelExporterOptions {
|
|
22
|
+
/** e.g. `metrics.getMeter("my-app")` from `@opentelemetry/api`. */
|
|
23
|
+
meter: OtelMeterLike;
|
|
24
|
+
/** Renders slower than this also increment `render_pulse.render.slow`. Defaults to 16. */
|
|
25
|
+
slowRenderMs?: number | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Records every measurement as OpenTelemetry metrics:
|
|
29
|
+
* - `render_pulse.render.duration` (histogram, ms) with `render_pulse.area`, `render_pulse.route`, `render_pulse.phase`, `render_pulse.mode`
|
|
30
|
+
* - `render_pulse.render.slow` (counter) with the same attributes
|
|
31
|
+
* - `render_pulse.longtask.duration` (histogram, ms) with `render_pulse.area`, `render_pulse.route`, `render_pulse.kind`
|
|
32
|
+
*/
|
|
33
|
+
export declare function createOtelExporter(options: OtelExporterOptions): Exporter;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Exporter } from "../types.js";
|
|
2
|
+
type Attributes = Record<string, string | number | boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* The parts of an OpenTelemetry `Meter` this exporter uses. Structurally
|
|
5
|
+
* compatible with `@opentelemetry/api`'s `Meter`, so there's no dependency on it.
|
|
6
|
+
*/
|
|
7
|
+
export interface OtelMeterLike {
|
|
8
|
+
createHistogram: (name: string, options?: {
|
|
9
|
+
description?: string;
|
|
10
|
+
unit?: string;
|
|
11
|
+
}) => {
|
|
12
|
+
record: (value: number, attributes?: Attributes) => void;
|
|
13
|
+
};
|
|
14
|
+
createCounter: (name: string, options?: {
|
|
15
|
+
description?: string;
|
|
16
|
+
unit?: string;
|
|
17
|
+
}) => {
|
|
18
|
+
add: (value: number, attributes?: Attributes) => void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface OtelExporterOptions {
|
|
22
|
+
/** e.g. `metrics.getMeter("my-app")` from `@opentelemetry/api`. */
|
|
23
|
+
meter: OtelMeterLike;
|
|
24
|
+
/** Renders slower than this also increment `render_pulse.render.slow`. Defaults to 16. */
|
|
25
|
+
slowRenderMs?: number | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Records every measurement as OpenTelemetry metrics:
|
|
29
|
+
* - `render_pulse.render.duration` (histogram, ms) with `render_pulse.area`, `render_pulse.route`, `render_pulse.phase`, `render_pulse.mode`
|
|
30
|
+
* - `render_pulse.render.slow` (counter) with the same attributes
|
|
31
|
+
* - `render_pulse.longtask.duration` (histogram, ms) with `render_pulse.area`, `render_pulse.route`, `render_pulse.kind`
|
|
32
|
+
*/
|
|
33
|
+
export declare function createOtelExporter(options: OtelExporterOptions): Exporter;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=otel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel.d.ts","sourceRoot":"","sources":["../../src/export/otel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAC9C;QAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;KAAE,CAAC;IAClE,aAAa,EAAE,CACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAC9C;QAAE,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;KAAE,CAAC;CAChE;AAED,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,KAAK,EAAE,aAAa,CAAC;IACrB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,QAAQ,CAkCzE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the renders of the component that calls it, reported under `id`.
|
|
3
|
+
*
|
|
4
|
+
* Render counts are exact. The duration runs from the hook's call to the
|
|
5
|
+
* commit, so it also includes anything React renders after this component
|
|
6
|
+
* in the same update: an upper bound. Wrap the component in `<RenderMonitor>`
|
|
7
|
+
* when you need its own render time.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useRenderMonitor(id: string): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the renders of the component that calls it, reported under `id`.
|
|
3
|
+
*
|
|
4
|
+
* Render counts are exact. The duration runs from the hook's call to the
|
|
5
|
+
* commit, so it also includes anything React renders after this component
|
|
6
|
+
* in the same update: an upper bound. Wrap the component in `<RenderMonitor>`
|
|
7
|
+
* when you need its own render time.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useRenderMonitor(id: string): void;
|
|
10
|
+
//# sourceMappingURL=useRenderMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenderMonitor.d.ts","sourceRoot":"","sources":["../../src/hooks/useRenderMonitor.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAgBjD"}
|