@fluidframework/fluid-telemetry 2.74.0 → 2.81.0-374083

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/fluid-telemetry
2
2
 
3
+ ## 2.80.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.74.0
4
8
 
5
9
  Dependency updates only.
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryManager.d.ts","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,yBAAyB;IAIpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IALpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAS;gBAG7C,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,+BAA+B,EAClD,kBAAkB,EAAE,kBAAkB,EAAE;IAM1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAWvC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAalC"}
1
+ {"version":3,"file":"telemetryManager.d.ts","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,yBAAyB;IAIpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IALpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAS;gBAG7C,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,+BAA+B,EAClD,kBAAkB,EAAE,kBAAkB,EAAE;IAM1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAYvC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAalC"}
@@ -36,6 +36,7 @@ class ContainerTelemetryManager {
36
36
  */
37
37
  setupHeartbeatTelemetryEmission() {
38
38
  setInterval(() => {
39
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- container.connectionState may not be typed precisely
39
40
  if (this.container.connectionState === container_loader_1.ConnectionState.Connected) {
40
41
  const telemetry = this.telemetryProducer.produceHeartbeatTelemetry();
41
42
  for (const consumer of this.telemetryConsumers) {
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryManager.js","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAAmE;AAKnE,yEAGoC;AAIpC;;;;GAIG;AACH,MAAa,yBAAyB;IAGrC,YACkB,SAA0B,EAC1B,iBAAkD,EAClD,kBAAwC;QAFxC,cAAS,GAAT,SAAS,CAAiB;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAiC;QAClD,uBAAkB,GAAlB,kBAAkB,CAAsB;QAEzD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,+BAA+B,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,IAAI,CAAC,SAAS,CAAC,EAAE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8DA+DC;AA9DwB,wDAA8B,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\n\nimport type { ITelemetryConsumer } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport type { IContainerTelemetry } from \"./containerTelemetry.js\";\nimport type { ContainerEventTelemetryProducer } from \"./telemetryProducer.js\";\n\n/**\n * This class manages container telemetry intended for customers to consume by wiring together the provided container system events, telemetry producers and consumers together.\n * It manages subcribing to the proper raw container system events, sending them to the {@link ContainerEventTelemetryProducer}\n * to be transformed into {@link IContainerTelemetry} and finally sending them to the provided {@link ITelemetryConsumer}\n */\nexport class ContainerTelemetryManager {\n\tprivate static readonly HEARTBEAT_EMISSION_INTERNAL_MS = 60000;\n\n\tpublic constructor(\n\t\tprivate readonly container: IFluidContainer,\n\t\tprivate readonly telemetryProducer: ContainerEventTelemetryProducer,\n\t\tprivate readonly telemetryConsumers: ITelemetryConsumer[],\n\t) {\n\t\tthis.setupEventHandlers();\n\t\tthis.setupHeartbeatTelemetryEmission();\n\t}\n\n\t/**\n\t * Subscribes to the raw container system events and routes them to telemetry producers.\n\t */\n\tprivate setupEventHandlers(): void {\n\t\tthis.container.on(IFluidContainerSystemEventNames.CONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.CONNECTED),\n\t\t);\n\t\tthis.container.on(IFluidContainerSystemEventNames.DISCONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISCONNECTED),\n\t\t);\n\t\tthis.container.on(\n\t\t\tIFluidContainerSystemEventNames.DISPOSED,\n\t\t\t(error?: ICriticalContainerError) =>\n\t\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISPOSED, {\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Sets up the synthetic telemetry event for the container heartbeat telemetry to be emitted on a given time interval\n\t * if and only if the container is in a \"connected\" state. It is used to keep a pulse check on a live container\n\t */\n\tprivate setupHeartbeatTelemetryEmission(): void {\n\t\tsetInterval(() => {\n\t\t\tif (this.container.connectionState === ConnectionState.Connected) {\n\t\t\t\tconst telemetry = this.telemetryProducer.produceHeartbeatTelemetry();\n\t\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\t\tconsumer.consume(telemetry);\n\t\t\t\t}\n\t\t\t}\n\t\t}, ContainerTelemetryManager.HEARTBEAT_EMISSION_INTERNAL_MS);\n\t}\n\n\t/**\n\t * Handles the incoming raw container sysytem event, sending it to the {@link ContainerEventTelemetryProducer} to\n\t * produce {@link IContainerTelemetry} and sending it to the {@link ITelemetryConsumer} to be consumed.\n\t */\n\tprivate handleContainerSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): void {\n\t\tconst telemetry: IContainerTelemetry | undefined =\n\t\t\tthis.telemetryProducer.produceFromSystemEvent(eventName, payload);\n\n\t\tif (telemetry !== undefined) {\n\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\tconsumer.consume(telemetry);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"telemetryManager.js","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAAmE;AAKnE,yEAGoC;AAIpC;;;;GAIG;AACH,MAAa,yBAAyB;IAGrC,YACkB,SAA0B,EAC1B,iBAAkD,EAClD,kBAAwC;QAFxC,cAAS,GAAT,SAAS,CAAiB;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAiC;QAClD,uBAAkB,GAAlB,kBAAkB,CAAsB;QAEzD,IAAI,C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KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAChD,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;IACF,CAAC;;AA/DF,8DAgEC;AA/DwB,wDAA8B,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\n\nimport type { ITelemetryConsumer } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport type { IContainerTelemetry } from \"./containerTelemetry.js\";\nimport type { ContainerEventTelemetryProducer } from \"./telemetryProducer.js\";\n\n/**\n * This class manages container telemetry intended for customers to consume by wiring together the provided container system events, telemetry producers and consumers together.\n * It manages subcribing to the proper raw container system events, sending them to the {@link ContainerEventTelemetryProducer}\n * to be transformed into {@link IContainerTelemetry} and finally sending them to the provided {@link ITelemetryConsumer}\n */\nexport class ContainerTelemetryManager {\n\tprivate static readonly HEARTBEAT_EMISSION_INTERNAL_MS = 60000;\n\n\tpublic constructor(\n\t\tprivate readonly container: IFluidContainer,\n\t\tprivate readonly telemetryProducer: ContainerEventTelemetryProducer,\n\t\tprivate readonly telemetryConsumers: ITelemetryConsumer[],\n\t) {\n\t\tthis.setupEventHandlers();\n\t\tthis.setupHeartbeatTelemetryEmission();\n\t}\n\n\t/**\n\t * Subscribes to the raw container system events and routes them to telemetry producers.\n\t */\n\tprivate setupEventHandlers(): void {\n\t\tthis.container.on(IFluidContainerSystemEventNames.CONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.CONNECTED),\n\t\t);\n\t\tthis.container.on(IFluidContainerSystemEventNames.DISCONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISCONNECTED),\n\t\t);\n\t\tthis.container.on(\n\t\t\tIFluidContainerSystemEventNames.DISPOSED,\n\t\t\t(error?: ICriticalContainerError) =>\n\t\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISPOSED, {\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Sets up the synthetic telemetry event for the container heartbeat telemetry to be emitted on a given time interval\n\t * if and only if the container is in a \"connected\" state. It is used to keep a pulse check on a live container\n\t */\n\tprivate setupHeartbeatTelemetryEmission(): void {\n\t\tsetInterval(() => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- container.connectionState may not be typed precisely\n\t\t\tif (this.container.connectionState === ConnectionState.Connected) {\n\t\t\t\tconst telemetry = this.telemetryProducer.produceHeartbeatTelemetry();\n\t\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\t\tconsumer.consume(telemetry);\n\t\t\t\t}\n\t\t\t}\n\t\t}, ContainerTelemetryManager.HEARTBEAT_EMISSION_INTERNAL_MS);\n\t}\n\n\t/**\n\t * Handles the incoming raw container sysytem event, sending it to the {@link ContainerEventTelemetryProducer} to\n\t * produce {@link IContainerTelemetry} and sending it to the {@link ITelemetryConsumer} to be consumed.\n\t */\n\tprivate handleContainerSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): void {\n\t\tconst telemetry: IContainerTelemetry | undefined =\n\t\t\tthis.telemetryProducer.produceFromSystemEvent(eventName, payload);\n\n\t\tif (telemetry !== undefined) {\n\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\tconsumer.consume(telemetry);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
package/eslint.config.mts CHANGED
@@ -1,8 +1,8 @@
1
- /* eslint-disable */
2
- /**
3
- * GENERATED FILE - DO NOT EDIT DIRECTLY.
4
- * To regenerate: pnpm tsx scripts/generate-flat-eslint-configs.ts --typescript
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
5
4
  */
5
+
6
6
  import type { Linter } from "eslint";
7
7
  import { strict } from "../../../../common/build/eslint-config-fluid/flat.mts";
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryManager.d.ts","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,yBAAyB;IAIpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IALpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAS;gBAG7C,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,+BAA+B,EAClD,kBAAkB,EAAE,kBAAkB,EAAE;IAM1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAWvC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAalC"}
1
+ {"version":3,"file":"telemetryManager.d.ts","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,yBAAyB;IAIpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IALpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAS;gBAG7C,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,+BAA+B,EAClD,kBAAkB,EAAE,kBAAkB,EAAE;IAM1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAYvC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAalC"}
@@ -33,6 +33,7 @@ export class ContainerTelemetryManager {
33
33
  */
34
34
  setupHeartbeatTelemetryEmission() {
35
35
  setInterval(() => {
36
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- container.connectionState may not be typed precisely
36
37
  if (this.container.connectionState === ConnectionState.Connected) {
37
38
  const telemetry = this.telemetryProducer.produceHeartbeatTelemetry();
38
39
  for (const consumer of this.telemetryConsumers) {
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryManager.js","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAKnE,OAAO,EAEN,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AAIpC;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAGrC,YACkB,SAA0B,EAC1B,iBAAkD,EAClD,kBAAwC;QAFxC,cAAS,GAAT,SAAS,CAAiB;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAiC;QAClD,uBAAkB,GAAlB,kBAAkB,CAAsB;QAEzD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,+BAA+B,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,+BAA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G,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\n\nimport type { ITelemetryConsumer } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport type { IContainerTelemetry } from \"./containerTelemetry.js\";\nimport type { ContainerEventTelemetryProducer } from \"./telemetryProducer.js\";\n\n/**\n * This class manages container telemetry intended for customers to consume by wiring together the provided container system events, telemetry producers and consumers together.\n * It manages subcribing to the proper raw container system events, sending them to the {@link ContainerEventTelemetryProducer}\n * to be transformed into {@link IContainerTelemetry} and finally sending them to the provided {@link ITelemetryConsumer}\n */\nexport class ContainerTelemetryManager {\n\tprivate static readonly HEARTBEAT_EMISSION_INTERNAL_MS = 60000;\n\n\tpublic constructor(\n\t\tprivate readonly container: IFluidContainer,\n\t\tprivate readonly telemetryProducer: ContainerEventTelemetryProducer,\n\t\tprivate readonly telemetryConsumers: ITelemetryConsumer[],\n\t) {\n\t\tthis.setupEventHandlers();\n\t\tthis.setupHeartbeatTelemetryEmission();\n\t}\n\n\t/**\n\t * Subscribes to the raw container system events and routes them to telemetry producers.\n\t */\n\tprivate setupEventHandlers(): void {\n\t\tthis.container.on(IFluidContainerSystemEventNames.CONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.CONNECTED),\n\t\t);\n\t\tthis.container.on(IFluidContainerSystemEventNames.DISCONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISCONNECTED),\n\t\t);\n\t\tthis.container.on(\n\t\t\tIFluidContainerSystemEventNames.DISPOSED,\n\t\t\t(error?: ICriticalContainerError) =>\n\t\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISPOSED, {\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Sets up the synthetic telemetry event for the container heartbeat telemetry to be emitted on a given time interval\n\t * if and only if the container is in a \"connected\" state. It is used to keep a pulse check on a live container\n\t */\n\tprivate setupHeartbeatTelemetryEmission(): void {\n\t\tsetInterval(() => {\n\t\t\tif (this.container.connectionState === ConnectionState.Connected) {\n\t\t\t\tconst telemetry = this.telemetryProducer.produceHeartbeatTelemetry();\n\t\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\t\tconsumer.consume(telemetry);\n\t\t\t\t}\n\t\t\t}\n\t\t}, ContainerTelemetryManager.HEARTBEAT_EMISSION_INTERNAL_MS);\n\t}\n\n\t/**\n\t * Handles the incoming raw container sysytem event, sending it to the {@link ContainerEventTelemetryProducer} to\n\t * produce {@link IContainerTelemetry} and sending it to the {@link ITelemetryConsumer} to be consumed.\n\t */\n\tprivate handleContainerSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): void {\n\t\tconst telemetry: IContainerTelemetry | undefined =\n\t\t\tthis.telemetryProducer.produceFromSystemEvent(eventName, payload);\n\n\t\tif (telemetry !== undefined) {\n\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\tconsumer.consume(telemetry);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"telemetryManager.js","sourceRoot":"","sources":["../../src/container/telemetryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAKnE,OAAO,EAEN,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AAIpC;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAGrC,YACkB,SAA0B,EAC1B,iBAAkD,EAClD,kBAAwC;QAFxC,cAAS,GAAT,SAAS,CAAiB;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAiC;Q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AEnE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC7B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAChD,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;IACF,CAAC;;AA9DuB,wDAA8B,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\n\nimport type { ITelemetryConsumer } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport type { IContainerTelemetry } from \"./containerTelemetry.js\";\nimport type { ContainerEventTelemetryProducer } from \"./telemetryProducer.js\";\n\n/**\n * This class manages container telemetry intended for customers to consume by wiring together the provided container system events, telemetry producers and consumers together.\n * It manages subcribing to the proper raw container system events, sending them to the {@link ContainerEventTelemetryProducer}\n * to be transformed into {@link IContainerTelemetry} and finally sending them to the provided {@link ITelemetryConsumer}\n */\nexport class ContainerTelemetryManager {\n\tprivate static readonly HEARTBEAT_EMISSION_INTERNAL_MS = 60000;\n\n\tpublic constructor(\n\t\tprivate readonly container: IFluidContainer,\n\t\tprivate readonly telemetryProducer: ContainerEventTelemetryProducer,\n\t\tprivate readonly telemetryConsumers: ITelemetryConsumer[],\n\t) {\n\t\tthis.setupEventHandlers();\n\t\tthis.setupHeartbeatTelemetryEmission();\n\t}\n\n\t/**\n\t * Subscribes to the raw container system events and routes them to telemetry producers.\n\t */\n\tprivate setupEventHandlers(): void {\n\t\tthis.container.on(IFluidContainerSystemEventNames.CONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.CONNECTED),\n\t\t);\n\t\tthis.container.on(IFluidContainerSystemEventNames.DISCONNECTED, () =>\n\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISCONNECTED),\n\t\t);\n\t\tthis.container.on(\n\t\t\tIFluidContainerSystemEventNames.DISPOSED,\n\t\t\t(error?: ICriticalContainerError) =>\n\t\t\t\tthis.handleContainerSystemEvent(IFluidContainerSystemEventNames.DISPOSED, {\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Sets up the synthetic telemetry event for the container heartbeat telemetry to be emitted on a given time interval\n\t * if and only if the container is in a \"connected\" state. It is used to keep a pulse check on a live container\n\t */\n\tprivate setupHeartbeatTelemetryEmission(): void {\n\t\tsetInterval(() => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- container.connectionState may not be typed precisely\n\t\t\tif (this.container.connectionState === ConnectionState.Connected) {\n\t\t\t\tconst telemetry = this.telemetryProducer.produceHeartbeatTelemetry();\n\t\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\t\tconsumer.consume(telemetry);\n\t\t\t\t}\n\t\t\t}\n\t\t}, ContainerTelemetryManager.HEARTBEAT_EMISSION_INTERNAL_MS);\n\t}\n\n\t/**\n\t * Handles the incoming raw container sysytem event, sending it to the {@link ContainerEventTelemetryProducer} to\n\t * produce {@link IContainerTelemetry} and sending it to the {@link ITelemetryConsumer} to be consumed.\n\t */\n\tprivate handleContainerSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): void {\n\t\tconst telemetry: IContainerTelemetry | undefined =\n\t\t\tthis.telemetryProducer.produceFromSystemEvent(eventName, payload);\n\n\t\tif (telemetry !== undefined) {\n\t\t\tfor (const consumer of this.telemetryConsumers) {\n\t\t\t\tconsumer.consume(telemetry);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/fluid-telemetry",
3
- "version": "2.74.0",
3
+ "version": "2.81.0-374083",
4
4
  "description": "Customer facing Fluid telemetry types and classes for both producing and consuming said telemetry",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,33 +47,33 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/index.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/container-definitions": "~2.74.0",
51
- "@fluidframework/container-loader": "~2.74.0",
52
- "@fluidframework/fluid-static": "~2.74.0",
50
+ "@fluidframework/container-definitions": "2.81.0-374083",
51
+ "@fluidframework/container-loader": "2.81.0-374083",
52
+ "@fluidframework/fluid-static": "2.81.0-374083",
53
53
  "@microsoft/applicationinsights-web": "^2.8.11",
54
54
  "uuid": "^11.1.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@arethetypeswrong/cli": "^0.17.1",
57
+ "@arethetypeswrong/cli": "^0.18.2",
58
58
  "@biomejs/biome": "~1.9.3",
59
- "@fluid-internal/client-utils": "~2.74.0",
60
- "@fluid-internal/mocha-test-setup": "~2.74.0",
61
- "@fluid-tools/build-cli": "^0.61.0",
62
- "@fluidframework/build-tools": "^0.61.0",
63
- "@fluidframework/test-utils": "~2.74.0",
64
- "@fluidframework/tinylicious-client": "~2.74.0",
65
- "@fluidframework/tree": "~2.74.0",
59
+ "@fluid-internal/client-utils": "2.81.0-374083",
60
+ "@fluid-internal/mocha-test-setup": "2.81.0-374083",
61
+ "@fluid-tools/build-cli": "^0.63.0",
62
+ "@fluidframework/build-tools": "^0.63.0",
63
+ "@fluidframework/test-utils": "2.81.0-374083",
64
+ "@fluidframework/tinylicious-client": "2.81.0-374083",
65
+ "@fluidframework/tree": "2.81.0-374083",
66
66
  "@microsoft/api-extractor": "7.52.11",
67
67
  "@types/chai": "^4.0.0",
68
68
  "@types/mocha": "^10.0.10",
69
69
  "@types/sinon": "^17.0.3",
70
70
  "chai": "^4.2.0",
71
- "concurrently": "^8.2.1",
71
+ "concurrently": "^9.2.1",
72
72
  "copyfiles": "^2.4.1",
73
- "eslint": "~8.57.1",
73
+ "eslint": "~9.39.1",
74
74
  "jiti": "^2.6.1",
75
75
  "mocha": "^10.8.2",
76
- "rimraf": "^4.4.0",
76
+ "rimraf": "^6.1.2",
77
77
  "sinon": "^18.0.1",
78
78
  "start-server-and-test": "^2.0.3",
79
79
  "tinylicious": "^7.0.0",
@@ -58,6 +58,7 @@ export class ContainerTelemetryManager {
58
58
  */
59
59
  private setupHeartbeatTelemetryEmission(): void {
60
60
  setInterval(() => {
61
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- container.connectionState may not be typed precisely
61
62
  if (this.container.connectionState === ConnectionState.Connected) {
62
63
  const telemetry = this.telemetryProducer.produceHeartbeatTelemetry();
63
64
  for (const consumer of this.telemetryConsumers) {
package/.eslintrc.cjs DELETED
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"],
8
- parserOptions: {
9
- project: ["./tsconfig.json"],
10
- },
11
- };