Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createSubscriptionDiagnosticsArray(this: ServerSession) {
const subscriptionDiagnosticsArrayType =
this.addressSpace.findVariableType("SubscriptionDiagnosticsArrayType")!;
assert(subscriptionDiagnosticsArrayType.nodeId.toString() === "ns=0;i=2171");
this.subscriptionDiagnosticsArray =
createExtObjArrayNode(this.sessionObject, {
browseName: { namespaceIndex: 0, name: "SubscriptionDiagnosticsArray" },
complexVariableType: "SubscriptionDiagnosticsArrayType",
indexPropertyName: "subscriptionId",
minimumSamplingInterval: 2000, // 2 seconds
variableType: "SubscriptionDiagnosticsType",
});
}
createSessionDiagnosticSummaryUAObject.call(this);
session._sessionDiagnostics = session.sessionDiagnostics.$extensionObject;
assert(session._sessionDiagnostics.session === session);
const sessionDiagnosticsArray = session.getSessionDiagnosticsArray();
// add sessionDiagnostics into sessionDiagnoticsArray
eoan.addElement(session._sessionDiagnostics, sessionDiagnosticsArray);
}
const subscriptionDiagnosticsArrayType = session.addressSpace.findVariableType("SubscriptionDiagnosticsArrayType");
assert(subscriptionDiagnosticsArrayType.nodeId.toString() === "ns=0;i=2171");
session.subscriptionDiagnosticsArray=
eoan.createExtObjArrayNode(session.sessionObject, {
browseName: { namespaceIndex: 0,name:"SubscriptionDiagnosticsArray" },
complexVariableType: "SubscriptionDiagnosticsArrayType",
variableType: "SubscriptionDiagnosticsType",
indexPropertyName: "subscriptionId",
minimumSamplingInterval: 2000 // 2 seconds
});
return session.sessionObject;
};