@oneuptime/common 14.0.110 → 14.2.0
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/Models/DatabaseModels/AIRunRecording.d.mts +12 -0
- package/Models/DatabaseModels/AIRunRecording.d.ts +12 -0
- package/Models/DatabaseModels/AIRunRecording.js +181 -0
- package/Models/DatabaseModels/AIRunRecording.mjs +2 -0
- package/Models/DatabaseModels/Alert.d.mts +1 -0
- package/Models/DatabaseModels/Alert.d.ts +1 -0
- package/Models/DatabaseModels/Alert.js +52 -2
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/Models/DatabaseModels/DataStore.js +9 -0
- package/Models/DatabaseModels/EmailLog.js +2 -2
- package/Models/DatabaseModels/Form.js +3 -3
- package/Models/DatabaseModels/FormSubmission.js +4 -4
- package/Models/DatabaseModels/GlobalConfig.js +46 -45
- package/Models/DatabaseModels/Incident.d.mts +1 -0
- package/Models/DatabaseModels/Incident.d.ts +1 -0
- package/Models/DatabaseModels/Incident.js +53 -2
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
- package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
- package/Models/DatabaseModels/Index.js +6 -0
- package/Models/DatabaseModels/InventoryItem.js +11 -0
- package/Models/DatabaseModels/Monitor.js +51 -17
- package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
- package/Models/DatabaseModels/MonitorProbe.js +22 -5
- package/Models/DatabaseModels/NetworkDevice.js +23 -7
- package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
- package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
- package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
- package/Models/DatabaseModels/NetworkInterface.js +5 -5
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +19 -5
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
- package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
- package/Models/DatabaseModels/Project.d.mts +1 -0
- package/Models/DatabaseModels/Project.d.ts +1 -0
- package/Models/DatabaseModels/Project.js +46 -3
- package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
- package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
- package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
- package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
- package/Models/DatabaseModels/RunbookExecution.js +2 -2
- package/Models/DatabaseModels/RunbookRule.js +6 -6
- package/Models/DatabaseModels/ScheduledMaintenance.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
- package/Models/DatabaseModels/TeamMember.js +10 -1
- package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
- package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
- package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
- package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
- package/Server/Services/DatabaseService.d.mts +4 -1
- package/Server/Services/DatabaseService.d.ts +4 -1
- package/Server/Types/Database/CountBy.d.mts +1 -0
- package/Server/Types/Database/CountBy.d.ts +1 -0
- package/Server/Types/Database/UpdateLimit.d.mts +6 -0
- package/Server/Types/Database/UpdateLimit.d.ts +6 -0
- package/Types/AI/AIActionWords.d.mts +28 -2
- package/Types/AI/AIActionWords.d.ts +28 -2
- package/Types/AI/AIActionWords.js +235 -3
- package/Types/AI/AIActionWords.mjs +8 -0
- package/Types/AI/AIChatTypes.d.mts +3 -1
- package/Types/AI/AIChatTypes.d.ts +3 -1
- package/Types/AI/AIReadTableWords.d.mts +192 -0
- package/Types/AI/AIReadTableWords.d.ts +192 -0
- package/Types/AI/AIReadTableWords.js +368 -0
- package/Types/AI/AIReadTableWords.mjs +18 -0
- package/Types/AI/AiOutcomes.d.mts +57 -0
- package/Types/AI/AiOutcomes.d.ts +57 -0
- package/Types/AI/AiOutcomes.js +67 -0
- package/Types/AI/AiOutcomes.mjs +10 -0
- package/Types/AI/AiRunRefusal.d.mts +48 -0
- package/Types/AI/AiRunRefusal.d.ts +48 -0
- package/Types/AI/AiRunRefusal.js +208 -0
- package/Types/AI/AiRunRefusal.mjs +12 -0
- package/Types/AI/InvestigationRecording.d.mts +46 -0
- package/Types/AI/InvestigationRecording.d.ts +46 -0
- package/Types/AI/InvestigationRecording.js +42 -0
- package/Types/AI/InvestigationRecording.mjs +7 -0
- package/Types/AI/ResourceAiAccessPermissions.js +7 -18
- package/Types/API/HTTPResponse.d.mts +3 -0
- package/Types/API/HTTPResponse.d.ts +3 -0
- package/Types/API/HTTPResponse.js +15 -0
- package/Types/AuditLog/AuditLogActionLabel.js +19 -9
- package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
- package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +32 -1
- package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +32 -1
- package/Types/BaseDatabase/AggregationIntervalUtil.js +199 -2
- package/Types/BaseDatabase/ListResult.d.mts +1 -0
- package/Types/BaseDatabase/ListResult.d.ts +1 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
- package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
- package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
- package/Types/Cloud/CloudResourceHealth.js +405 -13
- package/Types/Cloud/CloudResourceHealth.mjs +28 -0
- package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
- package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
- package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
- package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
- package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
- package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
- package/Types/DataObservability/DataCheckRefusals.js +77 -0
- package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
- package/Types/Date.d.mts +8 -1
- package/Types/Date.d.ts +8 -1
- package/Types/Date.js +61 -7
- package/Types/Date.mjs +1 -0
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +8 -5
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
- package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
- package/Types/Email/ServerEmailEnvironment.js +793 -0
- package/Types/Email/ServerEmailEnvironment.mjs +14 -0
- package/Types/Exception/AiRunRefusalException.d.mts +6 -0
- package/Types/Exception/AiRunRefusalException.d.ts +6 -0
- package/Types/Exception/AiRunRefusalException.js +23 -0
- package/Types/Exception/AiRunRefusalException.mjs +2 -0
- package/Types/Exception/EgressGuardException.js +1 -1
- package/Types/Exception/ErrorMessageRule.d.mts +1 -0
- package/Types/Exception/ErrorMessageRule.d.ts +1 -0
- package/Types/Exception/ErrorMessageRule.js +67 -13
- package/Types/Exception/ErrorMessageRule.mjs +1 -0
- package/Types/Exception/ExceptionMessages.d.mts +2 -0
- package/Types/Exception/ExceptionMessages.d.ts +2 -0
- package/Types/Exception/ExceptionMessages.js +2 -0
- package/Types/Form/FormTargetCatalog.js +2 -2
- package/Types/Form/FormTargetType.js +2 -2
- package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.js +74 -0
- package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
- package/Types/JSONFunctions.js +10 -3
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/ListData.d.mts +2 -0
- package/Types/ListData.d.ts +2 -0
- package/Types/ListData.js +4 -0
- package/Types/MeaningKeys.d.mts +4 -0
- package/Types/MeaningKeys.d.ts +4 -0
- package/Types/MeaningKeys.js +74 -0
- package/Types/MeaningKeys.mjs +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
- package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
- package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
- package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
- package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
- package/Types/Monitor/UptimeHistoryLabels.js +2 -2
- package/Types/Monitor/WhoIsTold.d.mts +3 -0
- package/Types/Monitor/WhoIsTold.d.ts +3 -0
- package/Types/Monitor/WhoIsTold.js +63 -13
- package/Types/NoBreakSpaces.d.mts +16 -0
- package/Types/NoBreakSpaces.d.ts +16 -0
- package/Types/NoBreakSpaces.js +419 -0
- package/Types/NoBreakSpaces.mjs +9 -0
- package/Types/NotificationRule/PagingLadder.d.mts +12 -0
- package/Types/NotificationRule/PagingLadder.d.ts +12 -0
- package/Types/NotificationRule/PagingLadder.js +159 -11
- package/Types/NotificationRule/PagingLadder.mjs +3 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
- package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
- package/Types/OpenStack/OpenStackCapacity.js +12 -5
- package/Types/Permission.d.mts +4 -0
- package/Types/Permission.d.ts +4 -0
- package/Types/Permission.js +66 -10
- package/Types/Probe/ProbeCapability.d.mts +2 -1
- package/Types/Probe/ProbeCapability.d.ts +2 -1
- package/Types/Probe/ProbeCapability.js +10 -0
- package/Types/Product/ProductUsage.js +2 -1
- package/Types/Product/ProjectProductsAnswer.js +2 -1
- package/Types/ReaderLanguage.d.mts +1 -0
- package/Types/ReaderLanguage.d.ts +1 -0
- package/Types/ReaderLanguage.js +13 -1
- package/Types/ReaderLanguage.mjs +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.js +12 -0
- package/Types/Rules/RuleRun.js +2 -2
- package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
- package/Types/Rum/ProductAnalyticsEvents.js +13 -1
- package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.js +12 -0
- package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
- package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
- package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
- package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
- package/Types/ServerSending/ServerSendingStatus.js +49 -2
- package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
- package/Types/SetupHealth/SetupHealth.d.mts +1 -0
- package/Types/SetupHealth/SetupHealth.d.ts +1 -0
- package/Types/SetupHealth/SetupHealth.js +13 -5
- package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
- package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
- package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
- package/Types/StatusPage/DefaultStatusNames.js +74 -28
- package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
- package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
- package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
- package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
- package/Types/Telemetry/CompatibleIngest.js +123 -0
- package/Types/Telemetry/CompatibleIngest.mjs +21 -0
- package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
- package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
- package/Types/Telemetry/TelemetryIngestSurface.js +48 -7
- package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
- package/Types/TimezoneAlias.d.mts +1 -0
- package/Types/TimezoneAlias.d.ts +1 -0
- package/Types/TimezoneAlias.js +13 -0
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +470 -63
- package/Types/Translator.mjs +1 -0
- package/Types/UserSession/SessionLength.d.mts +33 -0
- package/Types/UserSession/SessionLength.d.ts +33 -0
- package/Types/UserSession/SessionLength.js +134 -5
- package/Types/UserSession/SessionLength.mjs +5 -0
- package/Types/Workflow/RunRecord.js +1 -1
- package/Types/Workflow/Templates.js +2 -2
- package/Types/Workflow/WorkflowStatus.js +21 -10
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +26 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +26 -1
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
- package/Utils/AI/InvestigationReport.js +2 -2
- package/Utils/API.d.mts +0 -11
- package/Utils/API.d.ts +0 -11
- package/Utils/API.js +0 -432
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
- package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
- package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
- package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
- package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
- package/Utils/DefaultRecordNames.d.mts +6 -0
- package/Utils/DefaultRecordNames.d.ts +6 -0
- package/Utils/DefaultRecordNames.js +122 -0
- package/Utils/DefaultRecordNames.mjs +6 -0
- package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
- package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
- package/Utils/Grok/Grok.js +7 -4
- package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
- package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
- package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
- package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
- package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
- package/Utils/HostAddressUtil.d.mts +1 -0
- package/Utils/HostAddressUtil.d.ts +1 -0
- package/Utils/HostAddressUtil.js +30 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
- package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
- package/Utils/LinearRegExp/LinearRegExp.js +5 -1
- package/Utils/LookupTable.d.mts +3 -0
- package/Utils/LookupTable.d.ts +3 -0
- package/Utils/LookupTable.js +61 -0
- package/Utils/LookupTable.mjs +3 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
- package/Utils/Markdown/OverLongText.js +296 -2
- package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
- package/Utils/Markdown/SlowMarkdown.js +354 -4
- package/Utils/Markdown/SlowMarkdown.mjs +1 -0
- package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
- package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
- package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
- package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
- package/Utils/Metrics/MetricSeriesScope.js +5 -1
- package/Utils/Milliseconds.d.mts +7 -0
- package/Utils/Milliseconds.d.ts +7 -0
- package/Utils/Milliseconds.js +60 -0
- package/Utils/Milliseconds.mjs +4 -0
- package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
- package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
- package/Utils/Monitor/EndpointAttachmentUtil.js +91 -21
- package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
- package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
- package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
- package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
- package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
- package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
- package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +5 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +5 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +148 -5
- package/Utils/Monitor/MonitoringOff.d.mts +2 -0
- package/Utils/Monitor/MonitoringOff.d.ts +2 -0
- package/Utils/Monitor/MonitoringOff.js +21 -0
- package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
- package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
- package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
- package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
- package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.js +58 -0
- package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
- package/Utils/Monitor/ProbeFailureReading.d.mts +18 -0
- package/Utils/Monitor/ProbeFailureReading.d.ts +18 -0
- package/Utils/Monitor/ProbeFailureReading.js +166 -0
- package/Utils/Monitor/ProbeFailureReading.mjs +8 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
- package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
- package/Utils/Project/NextNumber.js +1 -1
- package/Utils/PromQL/PromQLAst.d.mts +159 -0
- package/Utils/PromQL/PromQLAst.d.ts +159 -0
- package/Utils/PromQL/PromQLAst.js +118 -0
- package/Utils/PromQL/PromQLAst.mjs +12 -0
- package/Utils/PromQL/PromQLDuration.d.mts +2 -0
- package/Utils/PromQL/PromQLDuration.d.ts +2 -0
- package/Utils/PromQL/PromQLDuration.js +78 -0
- package/Utils/PromQL/PromQLDuration.mjs +3 -0
- package/Utils/PromQL/PromQLEngine.d.mts +15 -0
- package/Utils/PromQL/PromQLEngine.d.ts +15 -0
- package/Utils/PromQL/PromQLEngine.js +974 -0
- package/Utils/PromQL/PromQLEngine.mjs +7 -0
- package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
- package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
- package/Utils/PromQL/PromQLEngineTypes.js +10 -0
- package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
- package/Utils/PromQL/PromQLError.d.mts +11 -0
- package/Utils/PromQL/PromQLError.d.ts +11 -0
- package/Utils/PromQL/PromQLError.js +27 -0
- package/Utils/PromQL/PromQLError.mjs +3 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.js +829 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
- package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
- package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
- package/Utils/PromQL/PromQLFunctions.js +127 -0
- package/Utils/PromQL/PromQLFunctions.mjs +4 -0
- package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.js +212 -0
- package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
- package/Utils/PromQL/PromQLLabels.d.mts +11 -0
- package/Utils/PromQL/PromQLLabels.d.ts +11 -0
- package/Utils/PromQL/PromQLLabels.js +219 -0
- package/Utils/PromQL/PromQLLabels.mjs +9 -0
- package/Utils/PromQL/PromQLLexer.d.mts +39 -0
- package/Utils/PromQL/PromQLLexer.d.ts +39 -0
- package/Utils/PromQL/PromQLLexer.js +391 -0
- package/Utils/PromQL/PromQLLexer.mjs +3 -0
- package/Utils/PromQL/PromQLMath.d.mts +19 -0
- package/Utils/PromQL/PromQLMath.d.ts +19 -0
- package/Utils/PromQL/PromQLMath.js +200 -0
- package/Utils/PromQL/PromQLMath.mjs +9 -0
- package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
- package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
- package/Utils/PromQL/PromQLMetricNames.js +205 -0
- package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
- package/Utils/PromQL/PromQLParser.d.mts +4 -0
- package/Utils/PromQL/PromQLParser.d.ts +4 -0
- package/Utils/PromQL/PromQLParser.js +836 -0
- package/Utils/PromQL/PromQLParser.mjs +4 -0
- package/Utils/PromQL/PromQLRegex.d.mts +20 -0
- package/Utils/PromQL/PromQLRegex.d.ts +20 -0
- package/Utils/PromQL/PromQLRegex.js +1014 -0
- package/Utils/PromQL/PromQLRegex.mjs +5 -0
- package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
- package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
- package/Utils/PromQL/PrometheusResponse.js +92 -0
- package/Utils/PromQL/PrometheusResponse.mjs +3 -0
- package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
- package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
- package/Utils/PromQL/RE2CharacterClass.js +532 -0
- package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
- package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
- package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
- package/Utils/RequestFailedDetailsUtil.js +452 -0
- package/Utils/RequestFailedDetailsUtil.mjs +2 -0
- package/Utils/Rum/PathInSentence.d.mts +5 -0
- package/Utils/Rum/PathInSentence.d.ts +5 -0
- package/Utils/Rum/PathInSentence.js +46 -0
- package/Utils/Rum/PathInSentence.mjs +6 -0
- package/Utils/Rum/UrlScrubber.d.mts +5 -1
- package/Utils/Rum/UrlScrubber.d.ts +5 -1
- package/Utils/Rum/UrlScrubber.js +153 -7
- package/Utils/Rum/UserFlow.d.mts +1 -1
- package/Utils/Rum/UserFlow.d.ts +1 -1
- package/Utils/Rum/UserFlow.js +202 -29
- package/Utils/Rum/UserFlow.mjs +1 -1
- package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
- package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
- package/Utils/Runbook/RunbookStepsSignature.js +30 -0
- package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
- package/Utils/Schema/TypeSchemas.js +6 -0
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
- package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
- package/Utils/Slo/SloDuration.d.mts +5 -2
- package/Utils/Slo/SloDuration.d.ts +5 -2
- package/Utils/Slo/SloDuration.js +11 -6
- package/Utils/Slo/SloHealth.js +1 -1
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +3 -1
- package/Utils/StateListType.d.mts +11 -0
- package/Utils/StateListType.d.ts +11 -0
- package/Utils/StateListType.js +21 -0
- package/Utils/StateListType.mjs +2 -0
- package/Utils/StateOrder.d.mts +8 -11
- package/Utils/StateOrder.d.ts +8 -11
- package/Utils/StateOrder.js +50 -88
- package/Utils/StateOrder.mjs +2 -0
- package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
- package/Utils/Syslog/SyslogMessageParser.js +16 -6
- package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
- package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
- package/Utils/Telemetry/HeartbeatAvailability.js +113 -26
- package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
- package/Utils/ValueFormatter.d.mts +1 -0
- package/Utils/ValueFormatter.d.ts +1 -0
- package/Utils/ValueFormatter.js +258 -18
- package/package.json +1 -1
|
@@ -62,7 +62,15 @@ export interface EndpointExistingRowSnapshot {
|
|
|
62
62
|
firstSeenAt?: Date | undefined;
|
|
63
63
|
lastSeenAt?: Date | undefined;
|
|
64
64
|
}
|
|
65
|
+
export declare const ENDPOINT_WALK_WINDOW_MS: number;
|
|
65
66
|
export declare const ENDPOINT_LAST_SEEN_REFRESH_MS: number;
|
|
67
|
+
export declare const ENDPOINT_REFRESH_GROUPS: number;
|
|
68
|
+
export declare const COARSE_LAST_SEEN_STEP_SQL: string;
|
|
69
|
+
export declare function endpointRefreshSlot(data: {
|
|
70
|
+
time: number;
|
|
71
|
+
macAddress: string;
|
|
72
|
+
refreshMs: number;
|
|
73
|
+
}): number;
|
|
66
74
|
export declare const CONTROLLER_SIGHTING_CURRENT_FOR_MS: number;
|
|
67
75
|
export interface EndpointUpsertContext {
|
|
68
76
|
now: Date;
|
|
@@ -1,21 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeMac = exports.CONTROLLER_SIGHTING_CURRENT_FOR_MS = exports.ENDPOINT_LAST_SEEN_REFRESH_MS = void 0;
|
|
6
|
+
exports.normalizeMac = exports.CONTROLLER_SIGHTING_CURRENT_FOR_MS = exports.COARSE_LAST_SEEN_STEP_SQL = exports.ENDPOINT_REFRESH_GROUPS = exports.ENDPOINT_LAST_SEEN_REFRESH_MS = exports.ENDPOINT_WALK_WINDOW_MS = void 0;
|
|
7
|
+
exports.endpointRefreshSlot = endpointRefreshSlot;
|
|
8
|
+
const DeviceReachabilityUtil_1 = __importDefault(require("../NetworkDevice/DeviceReachabilityUtil"));
|
|
4
9
|
/*
|
|
5
10
|
* How stale a row's lastSeenAt is allowed to get before an otherwise
|
|
6
11
|
* unchanged observation is written purely to refresh it.
|
|
7
12
|
*
|
|
8
|
-
* Freshness is load-bearing:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* Freshness is load-bearing: the map draws an endpoint "down", the Discovered
|
|
14
|
+
* Devices list stops counting it, and the "Connected to" card stops matching
|
|
15
|
+
* a device by its address once lastSeenAt is older than the walk window
|
|
16
|
+
* (ENDPOINT_WALK_WINDOW_MS, the shared device staleness window at the default
|
|
17
|
+
* interval - 60 minutes). Suppressing the refresh entirely would mark every
|
|
18
|
+
* stable endpoint down, so the real bound is that stored lastSeenAt may lag
|
|
19
|
+
* reality by at most (refresh window + poll interval).
|
|
20
|
+
*
|
|
21
|
+
* It was a flat 5 minutes - the default poll interval itself - so every
|
|
22
|
+
* ARP/FDB walk rewrote every endpoint it saw; then just under two polls, so
|
|
23
|
+
* an unchanged endpoint was written every other poll. It is now 15 minutes,
|
|
24
|
+
* as an interface's refresh is (InterfaceInventoryUtil), counted on a clock
|
|
25
|
+
* of the endpoint's own (endpointRefreshSlot): at 5-minute polls a stable
|
|
26
|
+
* endpoint is written every third poll. The window plus a poll stays inside
|
|
27
|
+
* the walk window for every interval up to 45 minutes, and a device polled
|
|
28
|
+
* less often than the window writes on every poll, as before, so the refresh
|
|
29
|
+
* can never make an endpoint look gone.
|
|
17
30
|
*/
|
|
18
|
-
exports.
|
|
31
|
+
exports.ENDPOINT_WALK_WINDOW_MS = DeviceReachabilityUtil_1.default.getStaleWindowInMinutes(undefined) * 60 * 1000;
|
|
32
|
+
exports.ENDPOINT_LAST_SEEN_REFRESH_MS = 15 * 60 * 1000;
|
|
33
|
+
/*
|
|
34
|
+
* The refresh is spread across the window, not taken all at once: each
|
|
35
|
+
* endpoint counts its window on a clock of its own, offset by its MAC in
|
|
36
|
+
* steps of a fifteenth of the window (endpointRefreshSlot). A switch's
|
|
37
|
+
* endpoints then come due a few at a time - a third of them on each
|
|
38
|
+
* five-minute poll - rather than all of them on the same poll.
|
|
39
|
+
*
|
|
40
|
+
* That is what lets the refresh be a HOT update. A walk writes a device's
|
|
41
|
+
* endpoints in one statement, and the rows of a device's endpoints sit
|
|
42
|
+
* together, since its walk inserted them together. A page takes a HOT
|
|
43
|
+
* update only into room it has free while the statement runs, because the
|
|
44
|
+
* rows it replaces are not dead until the statement commits: rewriting every
|
|
45
|
+
* endpoint on a page at once needs half the page free. A third of them needs
|
|
46
|
+
* a quarter of the page, which is about the room the table keeps
|
|
47
|
+
* (fillfactor, SetNetworkEndpointFillfactor). The refresh also writes no
|
|
48
|
+
* indexed column: lastSeenAt is in no index (coarseLastSeenAt is the age-out's
|
|
49
|
+
* copy, and moves once a day).
|
|
50
|
+
*/
|
|
51
|
+
exports.ENDPOINT_REFRESH_GROUPS = 15;
|
|
52
|
+
/*
|
|
53
|
+
* How far an endpoint's lastSeenAt gets ahead of its coarseLastSeenAt before
|
|
54
|
+
* a write moves the coarse one up to it, as SQL: so coarseLastSeenAt <=
|
|
55
|
+
* lastSeenAt < coarseLastSeenAt + this. NetworkEndpointService writes by it
|
|
56
|
+
* and the age-out of discovered devices (DiscoveredDeviceAgeOut) narrows by
|
|
57
|
+
* it, so both must read this one. Hours, not '1 day': a day added to a
|
|
58
|
+
* timestamptz follows the session's time zone, and is 23 or 25 hours across
|
|
59
|
+
* a change of clocks.
|
|
60
|
+
*/
|
|
61
|
+
exports.COARSE_LAST_SEEN_STEP_SQL = `interval '24 hours'`;
|
|
62
|
+
/*
|
|
63
|
+
* Which refresh window of its own a time falls in, for one endpoint: windows
|
|
64
|
+
* of `refreshMs`, offset by the endpoint's MAC in steps of
|
|
65
|
+
* 1/ENDPOINT_REFRESH_GROUPS of a window. The group is the MAC's twelve hex
|
|
66
|
+
* digits as a number, modulo the groups: MACs that differ by one, as a batch
|
|
67
|
+
* of terminals from one vendor often do, come due a fifteenth of a window
|
|
68
|
+
* apart.
|
|
69
|
+
*/
|
|
70
|
+
function endpointRefreshSlot(data) {
|
|
71
|
+
const hex = data.macAddress.toLowerCase().replace(/[^0-9a-f]/g, "");
|
|
72
|
+
const value = hex ? parseInt(hex.slice(-12), 16) : 0;
|
|
73
|
+
const group = Number.isFinite(value)
|
|
74
|
+
? value % exports.ENDPOINT_REFRESH_GROUPS
|
|
75
|
+
: 0;
|
|
76
|
+
return Math.floor((data.time + (group * data.refreshMs) / exports.ENDPOINT_REFRESH_GROUPS) /
|
|
77
|
+
data.refreshMs);
|
|
78
|
+
}
|
|
19
79
|
/*
|
|
20
80
|
* How long a sighting a network controller reported stays current. A walk
|
|
21
81
|
* sees an endpoint every few minutes; a controller's client list is read
|
|
@@ -226,8 +286,8 @@ class EndpointAttachmentUtil {
|
|
|
226
286
|
* over; lastSeenAt is not refreshed meanwhile, or it never could.
|
|
227
287
|
*
|
|
228
288
|
* When `context` is supplied, an update that would write nothing but a
|
|
229
|
-
* lastSeenAt
|
|
230
|
-
* "none" — a stable 4096-MAC switch must not issue 4096 writes a poll
|
|
289
|
+
* lastSeenAt whose refresh is not due yet (endpointRefreshSlot) collapses
|
|
290
|
+
* to "none" — a stable 4096-MAC switch must not issue 4096 writes a poll
|
|
231
291
|
* just to bump a timestamp nobody reads that precisely.
|
|
232
292
|
*/
|
|
233
293
|
static decideUpsert(existing, incoming, context) {
|
|
@@ -299,7 +359,7 @@ class EndpointAttachmentUtil {
|
|
|
299
359
|
}
|
|
300
360
|
if (existing &&
|
|
301
361
|
context &&
|
|
302
|
-
EndpointAttachmentUtil.isUnchangedSighting(existing, decision, incoming
|
|
362
|
+
EndpointAttachmentUtil.isUnchangedSighting(existing, decision, incoming, context)) {
|
|
303
363
|
return {
|
|
304
364
|
action: "none",
|
|
305
365
|
setAttachment: false,
|
|
@@ -310,10 +370,11 @@ class EndpointAttachmentUtil {
|
|
|
310
370
|
}
|
|
311
371
|
/*
|
|
312
372
|
* True when applying `decision` to `existing` would change nothing a
|
|
313
|
-
* reader can observe, and
|
|
314
|
-
* refresh
|
|
315
|
-
*
|
|
316
|
-
*
|
|
373
|
+
* reader can observe, and the row's refresh is not due yet: the sighting
|
|
374
|
+
* falls in the same refresh window of the endpoint's own as the row's
|
|
375
|
+
* lastSeenAt (endpointRefreshSlot). Deliberately conservative — any doubt
|
|
376
|
+
* (a row that still needs the firstSeenAt backfill, a row we have never
|
|
377
|
+
* seen a timestamp for) falls through to a real write.
|
|
317
378
|
*
|
|
318
379
|
* A sighting older than the row's lastSeenAt refreshes nothing either.
|
|
319
380
|
* That is an older poll processed after a newer one (OneUptime issue
|
|
@@ -321,15 +382,24 @@ class EndpointAttachmentUtil {
|
|
|
321
382
|
* moves lastSeenAt backwards (NetworkEndpointService keeps the later of
|
|
322
383
|
* the two), so writing it would change nothing.
|
|
323
384
|
*/
|
|
324
|
-
static isUnchangedSighting(existing, decision,
|
|
385
|
+
static isUnchangedSighting(existing, decision, incoming, context) {
|
|
325
386
|
var _a;
|
|
387
|
+
const incomingDeviceId = incoming.deviceId;
|
|
326
388
|
// Rows predating first-seen tracking still owe us a backfill.
|
|
327
389
|
if (!existing.firstSeenAt || !existing.lastSeenAt) {
|
|
328
390
|
return false;
|
|
329
391
|
}
|
|
330
392
|
const refreshMs = (_a = context.lastSeenRefreshMs) !== null && _a !== void 0 ? _a : exports.ENDPOINT_LAST_SEEN_REFRESH_MS;
|
|
331
|
-
|
|
332
|
-
|
|
393
|
+
if (endpointRefreshSlot({
|
|
394
|
+
time: context.now.getTime(),
|
|
395
|
+
macAddress: incoming.macAddress,
|
|
396
|
+
refreshMs: refreshMs,
|
|
397
|
+
}) >
|
|
398
|
+
endpointRefreshSlot({
|
|
399
|
+
time: new Date(existing.lastSeenAt).getTime(),
|
|
400
|
+
macAddress: incoming.macAddress,
|
|
401
|
+
refreshMs: refreshMs,
|
|
402
|
+
})) {
|
|
333
403
|
return false;
|
|
334
404
|
}
|
|
335
405
|
if (decision.setIpAddress &&
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import commonJsModule from "./EndpointAttachmentUtil.js";
|
|
2
2
|
export default commonJsModule.default;
|
|
3
|
+
export const COARSE_LAST_SEEN_STEP_SQL = commonJsModule.COARSE_LAST_SEEN_STEP_SQL;
|
|
3
4
|
export const CONTROLLER_SIGHTING_CURRENT_FOR_MS = commonJsModule.CONTROLLER_SIGHTING_CURRENT_FOR_MS;
|
|
4
5
|
export const ENDPOINT_LAST_SEEN_REFRESH_MS = commonJsModule.ENDPOINT_LAST_SEEN_REFRESH_MS;
|
|
6
|
+
export const ENDPOINT_REFRESH_GROUPS = commonJsModule.ENDPOINT_REFRESH_GROUPS;
|
|
7
|
+
export const ENDPOINT_WALK_WINDOW_MS = commonJsModule.ENDPOINT_WALK_WINDOW_MS;
|
|
8
|
+
export const endpointRefreshSlot = commonJsModule.endpointRefreshSlot;
|
|
5
9
|
export const normalizeMac = commonJsModule.normalizeMac;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import SnmpInterface from "../../Types/Monitor/SnmpMonitor/SnmpInterface.mjs";
|
|
2
|
+
export declare const INTERFACE_LAST_SEEN_REFRESH_MS: number;
|
|
3
|
+
export declare const INTERFACE_REFRESH_GROUPS: number;
|
|
4
|
+
export declare const INTERFACE_READING_RELATIVE_CHANGE: number;
|
|
5
|
+
export declare const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED: number;
|
|
6
|
+
export declare const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED: number;
|
|
7
|
+
export declare const INTERFACE_UTILIZATION_FLOOR_PERCENT: number;
|
|
8
|
+
export declare const INTERFACE_ERRORS_FLOOR_PER_SECOND: number;
|
|
9
|
+
export declare const INTERFACE_SATURATION_THRESHOLD_PERCENT: number;
|
|
2
10
|
export interface InterfaceExistingRowSnapshot {
|
|
3
11
|
interfaceIndex?: number | undefined;
|
|
4
12
|
isMonitored?: boolean | undefined;
|
|
13
|
+
name?: string | null | undefined;
|
|
14
|
+
alias?: string | null | undefined;
|
|
15
|
+
macAddress?: string | null | undefined;
|
|
16
|
+
interfaceType?: number | null | undefined;
|
|
17
|
+
isOperationallyUp?: boolean | null | undefined;
|
|
18
|
+
isAdministrativelyUp?: boolean | null | undefined;
|
|
19
|
+
speedInMbps?: number | null | undefined;
|
|
20
|
+
inRateMbps?: number | null | undefined;
|
|
21
|
+
outRateMbps?: number | null | undefined;
|
|
22
|
+
utilizationPercent?: number | null | undefined;
|
|
23
|
+
errorsPerSecond?: number | null | undefined;
|
|
24
|
+
lastSeenAt?: Date | string | null | undefined;
|
|
5
25
|
}
|
|
6
26
|
export interface InterfaceInsertRow {
|
|
7
27
|
interfaceIndex: number;
|
|
@@ -33,6 +53,7 @@ export interface InterfaceUpdateRow {
|
|
|
33
53
|
export interface InterfaceUpsertPlan {
|
|
34
54
|
inserts: Array<InterfaceInsertRow>;
|
|
35
55
|
updates: Array<InterfaceUpdateRow>;
|
|
56
|
+
unchangedInterfaceIndexes: Array<number>;
|
|
36
57
|
unmonitoredInterfaceIndexes: Array<number>;
|
|
37
58
|
}
|
|
38
59
|
export default class InterfaceInventoryUtil {
|
|
@@ -40,7 +61,26 @@ export default class InterfaceInventoryUtil {
|
|
|
40
61
|
walkedInterfaces: Array<SnmpInterface>;
|
|
41
62
|
existingRows: Array<InterfaceExistingRowSnapshot>;
|
|
42
63
|
now: Date;
|
|
64
|
+
refreshMs?: number | undefined;
|
|
43
65
|
}): InterfaceUpsertPlan;
|
|
66
|
+
static needsWrite(data: {
|
|
67
|
+
stored: InterfaceExistingRowSnapshot;
|
|
68
|
+
update: InterfaceUpdateRow;
|
|
69
|
+
now: Date;
|
|
70
|
+
refreshMs?: number | undefined;
|
|
71
|
+
}): boolean;
|
|
72
|
+
static refreshSlot(data: {
|
|
73
|
+
time: number;
|
|
74
|
+
interfaceIndex: number;
|
|
75
|
+
refreshMs: number;
|
|
76
|
+
}): number;
|
|
77
|
+
static ratesMoved(data: {
|
|
78
|
+
stored: InterfaceExistingRowSnapshot;
|
|
79
|
+
update: InterfaceUpdateRow;
|
|
80
|
+
}): boolean;
|
|
81
|
+
private static readingMoved;
|
|
82
|
+
private static isSame;
|
|
83
|
+
private static toTime;
|
|
44
84
|
private static interfaceName;
|
|
45
85
|
private static toMbps;
|
|
46
86
|
private static toRoundedMbps;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import SnmpInterface from "../../Types/Monitor/SnmpMonitor/SnmpInterface";
|
|
2
|
+
export declare const INTERFACE_LAST_SEEN_REFRESH_MS: number;
|
|
3
|
+
export declare const INTERFACE_REFRESH_GROUPS: number;
|
|
4
|
+
export declare const INTERFACE_READING_RELATIVE_CHANGE: number;
|
|
5
|
+
export declare const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED: number;
|
|
6
|
+
export declare const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED: number;
|
|
7
|
+
export declare const INTERFACE_UTILIZATION_FLOOR_PERCENT: number;
|
|
8
|
+
export declare const INTERFACE_ERRORS_FLOOR_PER_SECOND: number;
|
|
9
|
+
export declare const INTERFACE_SATURATION_THRESHOLD_PERCENT: number;
|
|
2
10
|
export interface InterfaceExistingRowSnapshot {
|
|
3
11
|
interfaceIndex?: number | undefined;
|
|
4
12
|
isMonitored?: boolean | undefined;
|
|
13
|
+
name?: string | null | undefined;
|
|
14
|
+
alias?: string | null | undefined;
|
|
15
|
+
macAddress?: string | null | undefined;
|
|
16
|
+
interfaceType?: number | null | undefined;
|
|
17
|
+
isOperationallyUp?: boolean | null | undefined;
|
|
18
|
+
isAdministrativelyUp?: boolean | null | undefined;
|
|
19
|
+
speedInMbps?: number | null | undefined;
|
|
20
|
+
inRateMbps?: number | null | undefined;
|
|
21
|
+
outRateMbps?: number | null | undefined;
|
|
22
|
+
utilizationPercent?: number | null | undefined;
|
|
23
|
+
errorsPerSecond?: number | null | undefined;
|
|
24
|
+
lastSeenAt?: Date | string | null | undefined;
|
|
5
25
|
}
|
|
6
26
|
export interface InterfaceInsertRow {
|
|
7
27
|
interfaceIndex: number;
|
|
@@ -33,6 +53,7 @@ export interface InterfaceUpdateRow {
|
|
|
33
53
|
export interface InterfaceUpsertPlan {
|
|
34
54
|
inserts: Array<InterfaceInsertRow>;
|
|
35
55
|
updates: Array<InterfaceUpdateRow>;
|
|
56
|
+
unchangedInterfaceIndexes: Array<number>;
|
|
36
57
|
unmonitoredInterfaceIndexes: Array<number>;
|
|
37
58
|
}
|
|
38
59
|
export default class InterfaceInventoryUtil {
|
|
@@ -40,7 +61,26 @@ export default class InterfaceInventoryUtil {
|
|
|
40
61
|
walkedInterfaces: Array<SnmpInterface>;
|
|
41
62
|
existingRows: Array<InterfaceExistingRowSnapshot>;
|
|
42
63
|
now: Date;
|
|
64
|
+
refreshMs?: number | undefined;
|
|
43
65
|
}): InterfaceUpsertPlan;
|
|
66
|
+
static needsWrite(data: {
|
|
67
|
+
stored: InterfaceExistingRowSnapshot;
|
|
68
|
+
update: InterfaceUpdateRow;
|
|
69
|
+
now: Date;
|
|
70
|
+
refreshMs?: number | undefined;
|
|
71
|
+
}): boolean;
|
|
72
|
+
static refreshSlot(data: {
|
|
73
|
+
time: number;
|
|
74
|
+
interfaceIndex: number;
|
|
75
|
+
refreshMs: number;
|
|
76
|
+
}): number;
|
|
77
|
+
static ratesMoved(data: {
|
|
78
|
+
stored: InterfaceExistingRowSnapshot;
|
|
79
|
+
update: InterfaceUpdateRow;
|
|
80
|
+
}): boolean;
|
|
81
|
+
private static readingMoved;
|
|
82
|
+
private static isSame;
|
|
83
|
+
private static toTime;
|
|
44
84
|
private static interfaceName;
|
|
45
85
|
private static toMbps;
|
|
46
86
|
private static toRoundedMbps;
|
|
@@ -3,13 +3,89 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.INTERFACE_SATURATION_THRESHOLD_PERCENT = exports.INTERFACE_ERRORS_FLOOR_PER_SECOND = exports.INTERFACE_UTILIZATION_FLOOR_PERCENT = exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = exports.INTERFACE_READING_RELATIVE_CHANGE = exports.INTERFACE_REFRESH_GROUPS = exports.INTERFACE_LAST_SEEN_REFRESH_MS = void 0;
|
|
6
7
|
const ColumnLength_1 = __importDefault(require("../../Types/Database/ColumnLength"));
|
|
8
|
+
/*
|
|
9
|
+
* Pure helpers that turn ONE device's IF-MIB walk into the exact rows the
|
|
10
|
+
* NetworkInterface inventory should insert and update, plus the set of
|
|
11
|
+
* interface indexes the user has muted. Everything here is deterministic and
|
|
12
|
+
* side-effect free so the column-by-column contract can be tested without a
|
|
13
|
+
* database; the batched SQL that applies it lives in NetworkInterfaceService.
|
|
14
|
+
*
|
|
15
|
+
* This mirrors EndpointAttachmentUtil.decideUpsert / NetworkEndpointService:
|
|
16
|
+
* the decision is pure, the persistence is one statement per chunk - and, as
|
|
17
|
+
* there, a row the walk would leave as it is costs no write at all.
|
|
18
|
+
*/
|
|
19
|
+
/*
|
|
20
|
+
* How long a stored interface may go unwritten before a walk that found
|
|
21
|
+
* nothing new about it writes it anyway, to move its lastSeenAt.
|
|
22
|
+
*
|
|
23
|
+
* A walk used to rewrite every interface it saw, on every poll: 3 million
|
|
24
|
+
* interfaces on five-minute polls is 10,000 new row versions a second, each
|
|
25
|
+
* one WAL, a dead tuple and vacuum work, for rows that had not changed.
|
|
26
|
+
* Now an interface whose inventory and state are as stored, and whose rates
|
|
27
|
+
* have not moved noticeably (ratesMoved), is written once per this window:
|
|
28
|
+
* once in every three polls at the default five minutes.
|
|
29
|
+
*
|
|
30
|
+
* Nothing in the product reads an interface's lastSeenAt: the device list,
|
|
31
|
+
* the Interfaces tab, the topology and the alerting all read the device's
|
|
32
|
+
* own lastSeenAt / lastSnmpSeenAt, and the interface's state. So an
|
|
33
|
+
* interface's lastSeenAt is accurate to this window (and one poll), and the
|
|
34
|
+
* API says so.
|
|
35
|
+
*/
|
|
36
|
+
exports.INTERFACE_LAST_SEEN_REFRESH_MS = 15 * 60 * 1000;
|
|
37
|
+
/*
|
|
38
|
+
* The refresh is spread across the window, not taken all at once: each
|
|
39
|
+
* interface counts its window on a clock of its own, offset by its ifIndex
|
|
40
|
+
* in steps of a fifteenth of the window (refreshSlot). A switch's ports then
|
|
41
|
+
* come due a few at a time - a third of them on each five-minute poll -
|
|
42
|
+
* rather than all of them on every third poll.
|
|
43
|
+
*
|
|
44
|
+
* That is what lets the refresh be a HOT update. A walk writes a device's
|
|
45
|
+
* ports in one statement, and its rows sit together on a page or two. A
|
|
46
|
+
* page takes a HOT update only into room it has free while the statement
|
|
47
|
+
* runs, because the rows it replaces are not dead until the statement
|
|
48
|
+
* commits: rewriting every port on a page at once needed half the page
|
|
49
|
+
* free, so most of each refresh left the page, wrote an entry into every
|
|
50
|
+
* index, and left dead ones for vacuum. A third of the ports needs a
|
|
51
|
+
* quarter of the page, which is about the room the table keeps (fillfactor,
|
|
52
|
+
* SetNetworkInterfaceFillfactor1809164000000).
|
|
53
|
+
*/
|
|
54
|
+
exports.INTERFACE_REFRESH_GROUPS = 15;
|
|
55
|
+
/*
|
|
56
|
+
* When a walk writes an interface's readings again (ratesMoved). The stored
|
|
57
|
+
* readings are what the Interfaces tab, the device's interface preview and
|
|
58
|
+
* the topology's links show; their history is in the interface metrics,
|
|
59
|
+
* written on every poll. A reading is written again when it moves by at
|
|
60
|
+
* least a tenth of the larger of the two readings AND by more than noise:
|
|
61
|
+
*
|
|
62
|
+
* in / out rate 1% of the link's speed, 1 Mbps when it reports none
|
|
63
|
+
* utilization one percentage point
|
|
64
|
+
* errors / second 0.01, the resolution it is stored at
|
|
65
|
+
*
|
|
66
|
+
* and always when it crosses a line a reader draws: utilization reaching or
|
|
67
|
+
* leaving INTERFACE_SATURATION_THRESHOLD_PERCENT (a saturated link on the
|
|
68
|
+
* map, a highlighted row in the preview), errors starting or stopping (the
|
|
69
|
+
* preview's attention order), and a reading appearing or going away (a dash
|
|
70
|
+
* in the table).
|
|
71
|
+
*/
|
|
72
|
+
exports.INTERFACE_READING_RELATIVE_CHANGE = 0.1;
|
|
73
|
+
exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = 0.01;
|
|
74
|
+
exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = 1;
|
|
75
|
+
exports.INTERFACE_UTILIZATION_FLOOR_PERCENT = 1;
|
|
76
|
+
exports.INTERFACE_ERRORS_FLOOR_PER_SECOND = 0.01;
|
|
77
|
+
/*
|
|
78
|
+
* Utilization at or above this reads as saturated: the topology's link state
|
|
79
|
+
* (LINK_SATURATION_THRESHOLD_PERCENT in the dashboard) and the interface
|
|
80
|
+
* preview's highlight both draw the line here.
|
|
81
|
+
*/
|
|
82
|
+
exports.INTERFACE_SATURATION_THRESHOLD_PERCENT = 80;
|
|
7
83
|
// Bits/sec on the wire; Mbps in the inventory.
|
|
8
84
|
const BITS_PER_MEGABIT = 1000000;
|
|
9
85
|
/*
|
|
10
86
|
* Rate columns are stored rounded to three decimals (kbps resolution). The
|
|
11
|
-
* rounding is part of the stored value, not presentation
|
|
12
|
-
*
|
|
87
|
+
* rounding is part of the stored value, not presentation. Whether a moved
|
|
88
|
+
* rate is written at all is ratesMoved's call.
|
|
13
89
|
*/
|
|
14
90
|
const RATE_DECIMAL_SCALE = 1000;
|
|
15
91
|
/*
|
|
@@ -30,17 +106,21 @@ function truncateShortText(value) {
|
|
|
30
106
|
class InterfaceInventoryUtil {
|
|
31
107
|
/*
|
|
32
108
|
* (walked interfaces, stored rows, walk timestamp) -> (rows to insert,
|
|
33
|
-
* rows to update, muted indexes).
|
|
109
|
+
* rows to update, rows left as they are, muted indexes).
|
|
34
110
|
*
|
|
35
111
|
* lastSeenAt is stamped from the caller's single `now` for every row, so a
|
|
36
112
|
* 400-port chassis does not end up with 400 slightly different timestamps
|
|
37
113
|
* that make "which ports answered on this walk" unanswerable.
|
|
114
|
+
*
|
|
115
|
+
* A known interface is updated only when needsWrite says so; otherwise it
|
|
116
|
+
* is listed as unchanged and costs nothing. `refreshMs` is for tests.
|
|
38
117
|
*/
|
|
39
118
|
static planWalkUpsert(data) {
|
|
40
119
|
var _a, _b, _c, _d;
|
|
41
120
|
const plan = {
|
|
42
121
|
inserts: [],
|
|
43
122
|
updates: [],
|
|
123
|
+
unchangedInterfaceIndexes: [],
|
|
44
124
|
unmonitoredInterfaceIndexes: [],
|
|
45
125
|
};
|
|
46
126
|
/*
|
|
@@ -75,7 +155,7 @@ class InterfaceInventoryUtil {
|
|
|
75
155
|
plan.unmonitoredInterfaceIndexes.push(walked.interfaceIndex);
|
|
76
156
|
}
|
|
77
157
|
if (existing) {
|
|
78
|
-
|
|
158
|
+
const update = {
|
|
79
159
|
interfaceIndex: walked.interfaceIndex,
|
|
80
160
|
name: InterfaceInventoryUtil.interfaceName(walked),
|
|
81
161
|
alias: truncateShortText(walked.alias),
|
|
@@ -89,7 +169,18 @@ class InterfaceInventoryUtil {
|
|
|
89
169
|
utilizationPercent: (_b = walked.utilizationPercent) !== null && _b !== void 0 ? _b : null,
|
|
90
170
|
errorsPerSecond: (_c = walked.errorsPerSecond) !== null && _c !== void 0 ? _c : null,
|
|
91
171
|
lastSeenAt: data.now,
|
|
92
|
-
}
|
|
172
|
+
};
|
|
173
|
+
if (InterfaceInventoryUtil.needsWrite({
|
|
174
|
+
stored: existing,
|
|
175
|
+
update: update,
|
|
176
|
+
now: data.now,
|
|
177
|
+
refreshMs: data.refreshMs,
|
|
178
|
+
})) {
|
|
179
|
+
plan.updates.push(update);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
plan.unchangedInterfaceIndexes.push(walked.interfaceIndex);
|
|
183
|
+
}
|
|
93
184
|
}
|
|
94
185
|
else {
|
|
95
186
|
plan.inserts.push({
|
|
@@ -108,6 +199,127 @@ class InterfaceInventoryUtil {
|
|
|
108
199
|
}
|
|
109
200
|
return plan;
|
|
110
201
|
}
|
|
202
|
+
/*
|
|
203
|
+
* Whether a walk writes a stored interface again, given the row the walk
|
|
204
|
+
* would write. In order:
|
|
205
|
+
*
|
|
206
|
+
* 1. Never when the row was last seen at or after this walk. A newer walk
|
|
207
|
+
* wrote it, and the UPDATE's own WHERE would refuse it anyway (an older
|
|
208
|
+
* poll processed after a newer one, OneUptime issue #7389).
|
|
209
|
+
* 2. Always when the row has no lastSeenAt, or was last written in an
|
|
210
|
+
* earlier refresh slot of its own (refreshSlot: a window of
|
|
211
|
+
* INTERFACE_LAST_SEEN_REFRESH_MS, offset by its ifIndex): its
|
|
212
|
+
* lastSeenAt moves, and so does any reading that moved too little to
|
|
213
|
+
* be written on its own. So an answering interface's lastSeenAt is
|
|
214
|
+
* never more than one window and one poll old.
|
|
215
|
+
* 3. Always when anything the walk reads about the port changed: its
|
|
216
|
+
* name, alias, MAC, type, speed, or its operational or administrative
|
|
217
|
+
* state. Compared exactly, after the same truncation and unit
|
|
218
|
+
* conversion the write applies.
|
|
219
|
+
* 4. When a reading moved noticeably (ratesMoved).
|
|
220
|
+
*
|
|
221
|
+
* Otherwise the row is left as it is. isMonitored plays no part: the walk
|
|
222
|
+
* never writes it.
|
|
223
|
+
*/
|
|
224
|
+
static needsWrite(data) {
|
|
225
|
+
var _a;
|
|
226
|
+
const stored = data.stored;
|
|
227
|
+
const update = data.update;
|
|
228
|
+
const lastSeenAt = InterfaceInventoryUtil.toTime(stored.lastSeenAt);
|
|
229
|
+
if (lastSeenAt !== null && lastSeenAt >= data.now.getTime()) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
if (lastSeenAt === null) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
const refreshMs = (_a = data.refreshMs) !== null && _a !== void 0 ? _a : exports.INTERFACE_LAST_SEEN_REFRESH_MS;
|
|
236
|
+
if (InterfaceInventoryUtil.refreshSlot({
|
|
237
|
+
time: data.now.getTime(),
|
|
238
|
+
interfaceIndex: update.interfaceIndex,
|
|
239
|
+
refreshMs: refreshMs,
|
|
240
|
+
}) >
|
|
241
|
+
InterfaceInventoryUtil.refreshSlot({
|
|
242
|
+
time: lastSeenAt,
|
|
243
|
+
interfaceIndex: update.interfaceIndex,
|
|
244
|
+
refreshMs: refreshMs,
|
|
245
|
+
})) {
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
if (!InterfaceInventoryUtil.isSame(stored.name, update.name) ||
|
|
249
|
+
!InterfaceInventoryUtil.isSame(stored.alias, update.alias) ||
|
|
250
|
+
!InterfaceInventoryUtil.isSame(stored.macAddress, update.macAddress) ||
|
|
251
|
+
!InterfaceInventoryUtil.isSame(stored.interfaceType, update.interfaceType) ||
|
|
252
|
+
!InterfaceInventoryUtil.isSame(stored.isOperationallyUp, update.isOperationallyUp) ||
|
|
253
|
+
!InterfaceInventoryUtil.isSame(stored.isAdministrativelyUp, update.isAdministrativelyUp) ||
|
|
254
|
+
!InterfaceInventoryUtil.isSame(stored.speedInMbps, update.speedInMbps)) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
return InterfaceInventoryUtil.ratesMoved({ stored, update });
|
|
258
|
+
}
|
|
259
|
+
/*
|
|
260
|
+
* Which refresh window of its own a time falls in, for one interface:
|
|
261
|
+
* windows of `refreshMs`, offset by the interface's ifIndex in steps of
|
|
262
|
+
* 1/INTERFACE_REFRESH_GROUPS of a window. Interfaces whose ifIndex differs
|
|
263
|
+
* by one come due a fifteenth of a window apart, so a device's ports are
|
|
264
|
+
* spread evenly across it (see INTERFACE_REFRESH_GROUPS for why).
|
|
265
|
+
*/
|
|
266
|
+
static refreshSlot(data) {
|
|
267
|
+
const group = ((Math.trunc(data.interfaceIndex) % exports.INTERFACE_REFRESH_GROUPS) +
|
|
268
|
+
exports.INTERFACE_REFRESH_GROUPS) %
|
|
269
|
+
exports.INTERFACE_REFRESH_GROUPS;
|
|
270
|
+
return Math.floor((data.time + (group * data.refreshMs) / exports.INTERFACE_REFRESH_GROUPS) /
|
|
271
|
+
data.refreshMs);
|
|
272
|
+
}
|
|
273
|
+
/*
|
|
274
|
+
* Whether any of the four readings moved enough to be written on its own
|
|
275
|
+
* (see INTERFACE_READING_RELATIVE_CHANGE for the rule and why).
|
|
276
|
+
*/
|
|
277
|
+
static ratesMoved(data) {
|
|
278
|
+
const stored = data.stored;
|
|
279
|
+
const update = data.update;
|
|
280
|
+
const rateFloorMbps = update.speedInMbps !== null && update.speedInMbps > 0
|
|
281
|
+
? update.speedInMbps * exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED
|
|
282
|
+
: exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED;
|
|
283
|
+
const isSaturated = (utilization) => {
|
|
284
|
+
return (utilization !== null && utilization !== void 0 ? utilization : 0) >= exports.INTERFACE_SATURATION_THRESHOLD_PERCENT;
|
|
285
|
+
};
|
|
286
|
+
const hasErrors = (errorsPerSecond) => {
|
|
287
|
+
return (errorsPerSecond !== null && errorsPerSecond !== void 0 ? errorsPerSecond : 0) > 0;
|
|
288
|
+
};
|
|
289
|
+
return (InterfaceInventoryUtil.readingMoved(stored.inRateMbps, update.inRateMbps, rateFloorMbps) ||
|
|
290
|
+
InterfaceInventoryUtil.readingMoved(stored.outRateMbps, update.outRateMbps, rateFloorMbps) ||
|
|
291
|
+
InterfaceInventoryUtil.readingMoved(stored.utilizationPercent, update.utilizationPercent, exports.INTERFACE_UTILIZATION_FLOOR_PERCENT) ||
|
|
292
|
+
isSaturated(stored.utilizationPercent) !==
|
|
293
|
+
isSaturated(update.utilizationPercent) ||
|
|
294
|
+
InterfaceInventoryUtil.readingMoved(stored.errorsPerSecond, update.errorsPerSecond, exports.INTERFACE_ERRORS_FLOOR_PER_SECOND) ||
|
|
295
|
+
hasErrors(stored.errorsPerSecond) !== hasErrors(update.errorsPerSecond));
|
|
296
|
+
}
|
|
297
|
+
/*
|
|
298
|
+
* A reading that appeared or went away moved; two readings moved when
|
|
299
|
+
* they are at least `floor` apart and at least a tenth of the larger one.
|
|
300
|
+
*/
|
|
301
|
+
static readingMoved(stored, current, floor) {
|
|
302
|
+
const before = stored !== null && stored !== void 0 ? stored : null;
|
|
303
|
+
if (before === null || current === null) {
|
|
304
|
+
return before !== current;
|
|
305
|
+
}
|
|
306
|
+
const change = Math.abs(current - before);
|
|
307
|
+
return (change >= floor &&
|
|
308
|
+
change >=
|
|
309
|
+
exports.INTERFACE_READING_RELATIVE_CHANGE *
|
|
310
|
+
Math.max(Math.abs(before), Math.abs(current)));
|
|
311
|
+
}
|
|
312
|
+
// Null and undefined are both "nothing stored".
|
|
313
|
+
static isSame(stored, current) {
|
|
314
|
+
return (stored !== null && stored !== void 0 ? stored : null) === current;
|
|
315
|
+
}
|
|
316
|
+
static toTime(value) {
|
|
317
|
+
if (value === null || value === undefined) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
const time = new Date(value).getTime();
|
|
321
|
+
return isNaN(time) ? null : time;
|
|
322
|
+
}
|
|
111
323
|
/*
|
|
112
324
|
* `name` is NOT NULL in the schema, and some agents return an empty
|
|
113
325
|
* ifDescr for tunnel/loopback pseudo-interfaces — hence the empty-string
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import commonJsModule from "./InterfaceInventoryUtil.js";
|
|
2
2
|
export default commonJsModule.default;
|
|
3
|
+
export const INTERFACE_ERRORS_FLOOR_PER_SECOND = commonJsModule.INTERFACE_ERRORS_FLOOR_PER_SECOND;
|
|
4
|
+
export const INTERFACE_LAST_SEEN_REFRESH_MS = commonJsModule.INTERFACE_LAST_SEEN_REFRESH_MS;
|
|
5
|
+
export const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = commonJsModule.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED;
|
|
6
|
+
export const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = commonJsModule.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED;
|
|
7
|
+
export const INTERFACE_READING_RELATIVE_CHANGE = commonJsModule.INTERFACE_READING_RELATIVE_CHANGE;
|
|
8
|
+
export const INTERFACE_REFRESH_GROUPS = commonJsModule.INTERFACE_REFRESH_GROUPS;
|
|
9
|
+
export const INTERFACE_SATURATION_THRESHOLD_PERCENT = commonJsModule.INTERFACE_SATURATION_THRESHOLD_PERCENT;
|
|
10
|
+
export const INTERFACE_UTILIZATION_FLOOR_PERCENT = commonJsModule.INTERFACE_UTILIZATION_FLOOR_PERCENT;
|