"use strict";
var import_Resource = require("#models/Resource.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import_Resource.Resource.add({
  tag: "cluster",
  name: "SoftwareDiagnostics",
  pics: "DGSW",
  xref: "core\xA711.13",
  details: "The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that may be used by a Node to assist a user or Administrator in diagnosing potential problems. The Software Diagnostics Cluster attempts to centralize all metrics that are relevant to the software that may be running on a Node.",
  children: [
    {
      tag: "attribute",
      name: "FeatureMap",
      xref: "core\xA711.13.4",
      children: [{
        tag: "field",
        name: "WTRMRK",
        details: "Node makes available the metrics for high watermark related to memory consumption."
      }]
    },
    {
      tag: "attribute",
      name: "ThreadMetrics",
      xref: "core\xA711.13.6.1",
      details: "This attribute shall be a list of ThreadMetricsStruct structs. Each active thread on the Node shall be represented by a single entry within the ThreadMetrics attribute."
    },
    {
      tag: "attribute",
      name: "CurrentHeapFree",
      xref: "core\xA711.13.6.2",
      details: "Indicates the current amount of heap memory, in bytes, that are free for allocation. The effective amount may be smaller due to heap fragmentation or other reasons."
    },
    {
      tag: "attribute",
      name: "CurrentHeapUsed",
      xref: "core\xA711.13.6.3",
      details: "Indicates the current amount of heap memory, in bytes, that is being used."
    },
    {
      tag: "attribute",
      name: "CurrentHeapHighWatermark",
      xref: "core\xA711.13.6.4",
      details: "Indicates the maximum amount of heap memory, in bytes, that has been used by the Node. This value shall only be reset upon a Node reboot or upon receiving of the ResetWatermarks command."
    },
    {
      tag: "event",
      name: "SoftwareFault",
      xref: "core\xA711.13.8.1",
      details: "This Event shall be generated when a software fault occurs on the Node.",
      children: [
        {
          tag: "field",
          name: "Id",
          xref: "core\xA711.13.8.1.1",
          details: "This field shall be set to the ID of the software thread in which the last software fault occurred."
        },
        {
          tag: "field",
          name: "Name",
          xref: "core\xA711.13.8.1.2",
          details: "This field shall be set to a manufacturer-specified name or prefix of the software thread in which the last software fault occurred."
        },
        {
          tag: "field",
          name: "FaultRecording",
          xref: "core\xA711.13.8.1.3",
          details: "This field shall be a manufacturer-specified payload intended to convey information to assist in further diagnosing or debugging a software fault. The FaultRecording field may be used to convey information such as, but not limited to, thread backtraces or register contents."
        }
      ]
    },
    {
      tag: "command",
      name: "ResetWatermarks",
      xref: "core\xA711.13.7.1",
      details: "This command is used to reset the high watermarks for heap and stack memory.\nReceipt of this command shall reset the following values which track high and lower watermarks:\n  \u2022 The StackFreeMinimum field of the ThreadMetrics attribute\n  \u2022 The CurrentHeapHighWatermark attribute\n### Effect on Receipt\nOn receipt of this command, the Node shall make the following modifications to attributes it supports:\nIf implemented, the server shall set the value of the CurrentHeapHighWatermark attribute to the value of the CurrentHeapUsed attribute.\nIf implemented, the server shall set the value of the StackFreeMinimum field for every thread to the value of the corresponding thread\u2019s StackFreeCurrent field."
    },
    {
      tag: "datatype",
      name: "ThreadMetricsStruct",
      xref: "core\xA711.13.5.1",
      children: [
        {
          tag: "field",
          name: "Id",
          xref: "core\xA711.13.5.1.1",
          details: "The Id field shall be a server-assigned per-thread unique ID that is constant for the duration of the thread. Efforts SHOULD be made to avoid reusing ID values when possible."
        },
        {
          tag: "field",
          name: "Name",
          xref: "core\xA711.13.5.1.2",
          details: "The Name field shall be set to a vendor defined name or prefix of the software thread that is static for the duration of the thread."
        },
        {
          tag: "field",
          name: "StackFreeCurrent",
          xref: "core\xA711.13.5.1.3",
          details: "The StackFreeCurrent field shall indicate the current amount of stack memory, in bytes, that are not being utilized on the respective thread."
        },
        {
          tag: "field",
          name: "StackFreeMinimum",
          xref: "core\xA711.13.5.1.4",
          details: "The StackFreeMinimum field shall indicate the minimum amount of stack memory, in bytes, that has been available at any point between the current time and this attribute being reset or initialized on the respective thread. This value shall only be reset upon a Node reboot or upon receiving of the ResetWatermarks command."
        },
        {
          tag: "field",
          name: "StackSize",
          xref: "core\xA711.13.5.1.5",
          details: "The StackSize field shall indicate the amount of stack memory, in bytes, that has been allocated for use by the respective thread."
        }
      ]
    }
  ]
});
//# sourceMappingURL=software-diagnostics.resource.js.map
