@oneuptime/common 11.6.1 → 11.7.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/AnalyticsModels/Index.ts +4 -0
- package/Models/AnalyticsModels/KubernetesCostAllocation.ts +842 -0
- package/Models/AnalyticsModels/NetworkFlow.ts +54 -0
- package/Models/AnalyticsModels/SloHistory.ts +243 -0
- package/Models/DatabaseModels/Index.ts +20 -0
- package/Models/DatabaseModels/NetworkDevice.ts +453 -6
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +7 -6
- package/Models/DatabaseModels/NetworkEndpoint.ts +753 -0
- package/Models/DatabaseModels/NetworkSite.ts +1155 -0
- package/Models/DatabaseModels/NetworkSiteAssignmentRule.ts +517 -0
- package/Models/DatabaseModels/NetworkSiteLink.ts +611 -0
- package/Models/DatabaseModels/NetworkSiteStatusTimeline.ts +520 -0
- package/Models/DatabaseModels/NetworkSiteType.ts +499 -0
- package/Models/DatabaseModels/ServiceLevelObjective.ts +1115 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.ts +762 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.ts +444 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.ts +443 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.ts +359 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.ts +48 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.ts +65 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.ts +88 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.ts +391 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.ts +30 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
- package/Server/Services/AnalyticsDatabaseService.ts +25 -9
- package/Server/Services/Index.ts +24 -0
- package/Server/Services/KubernetesCostAllocationService.ts +14 -0
- package/Server/Services/MetricService.ts +21 -2
- package/Server/Services/MonitorService.ts +22 -0
- package/Server/Services/NetworkDeviceService.ts +438 -2
- package/Server/Services/NetworkEndpointService.ts +414 -0
- package/Server/Services/NetworkSiteAssignmentRuleService.ts +98 -0
- package/Server/Services/NetworkSiteLinkService.ts +10 -0
- package/Server/Services/NetworkSiteService.ts +1254 -0
- package/Server/Services/NetworkSiteStatusTimelineService.ts +10 -0
- package/Server/Services/NetworkSiteTypeService.ts +10 -0
- package/Server/Services/ProjectService.ts +122 -2
- package/Server/Services/ServiceLevelObjectiveBurnRateRuleService.ts +457 -0
- package/Server/Services/ServiceLevelObjectiveOwnerTeamService.ts +10 -0
- package/Server/Services/ServiceLevelObjectiveOwnerUserService.ts +10 -0
- package/Server/Services/ServiceLevelObjectiveService.ts +685 -0
- package/Server/Services/SloHistoryService.ts +101 -0
- package/Server/Services/UserNotificationSettingService.ts +37 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +9 -0
- package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +15 -0
- package/Server/Utils/AnalyticsDatabase/Statement.ts +39 -3
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +87 -48
- package/Server/Utils/Memory.ts +9 -1
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +190 -12
- package/Server/Utils/Monitor/Data/OuiVendors.json +6920 -0
- package/Server/Utils/Monitor/DnsResolutionCache.ts +129 -0
- package/Server/Utils/Monitor/MonitorResource.ts +4 -30
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +214 -39
- package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +343 -0
- package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +251 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +176 -142
- package/Server/Utils/Monitor/OuiLookupUtil.ts +49 -0
- package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +17 -13
- package/Server/Utils/WhatsAppTemplateUtil.ts +7 -3
- package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +135 -0
- package/Tests/Models/NetworkSiteHierarchy.test.ts +134 -0
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +239 -0
- package/Tests/Server/Services/KubernetesCostAllocationAggregate.test.ts +338 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +142 -0
- package/Tests/Server/Services/NetworkDeviceSiteAssignment.test.ts +484 -0
- package/Tests/Server/Services/NetworkEndpointServiceUpsert.test.ts +686 -0
- package/Tests/Server/Services/NetworkSiteAssignmentRuleService.test.ts +185 -0
- package/Tests/Server/Services/NetworkSiteService.test.ts +1354 -0
- package/Tests/Server/Services/ServiceLevelObjectiveBurnRateRuleService.test.ts +1313 -0
- package/Tests/Server/Services/ServiceLevelObjectiveService.test.ts +1988 -0
- package/Tests/Server/Utils/AnalyticsDatabase/Statement.test.ts +22 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +404 -0
- package/Tests/Server/Utils/Encryption.test.ts +70 -0
- package/Tests/Server/Utils/FileAttachmentMarkdownUtil.test.ts +225 -0
- package/Tests/Server/Utils/JsonWebToken.test.ts +175 -0
- package/Tests/Server/Utils/LocalFile.test.ts +258 -0
- package/Tests/Server/Utils/Memory.test.ts +213 -0
- package/Tests/Server/Utils/Monitor/Criteria/LogMonitorCriteria.test.ts +30 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +385 -0
- package/Tests/Server/Utils/Monitor/DnsResolutionCache.test.ts +194 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +155 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +600 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +151 -124
- package/Tests/Server/Utils/Monitor/SnmpInterfaceRateUtil.test.ts +496 -0
- package/Tests/Server/Utils/MonitorCriteriaDataExtractor.test.ts +175 -0
- package/Tests/Server/Utils/MonitorCriteriaMessageFormatter.test.ts +282 -0
- package/Tests/Server/Utils/OuiLookupUtil.test.ts +59 -0
- package/Tests/Server/Utils/SeriesResourceLabels.test.ts +117 -0
- package/Tests/Server/Utils/StackTraceParser.test.ts +370 -0
- package/Tests/Server/Utils/Stream.test.ts +87 -0
- package/Tests/Server/Utils/ValidateGlobalProviderProjectTeams.test.ts +221 -0
- package/Tests/Server/Utils/WhatsAppTemplateUtil.test.ts +199 -0
- package/Tests/Types/Database/CompareOperatorWireSerialization.test.ts +33 -0
- package/Tests/Types/Email.test.ts +198 -0
- package/Tests/Types/Kubernetes/KubernetesObjectParser.test.ts +177 -0
- package/Tests/Types/Log/LogQueryToFilter.test.ts +111 -0
- package/Tests/Types/Monitor/MonitorCriteria.test.ts +155 -0
- package/Tests/Types/Monitor/MonitorCriteriaInstance.test.ts +465 -0
- package/Tests/Types/Monitor/MonitorStep.test.ts +183 -0
- package/Tests/Types/Monitor/MonitorStepNetworkDeviceMonitor.test.ts +141 -1
- package/Tests/Types/Monitor/MonitorSteps.test.ts +183 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +59 -1
- package/Tests/Types/Monitor/NetworkDeviceAlertPack.test.ts +97 -0
- package/Tests/Types/Monitor/SnmpEndpointDiscovery.test.ts +151 -0
- package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +110 -6
- package/Tests/Types/NetworkSite/DefaultNetworkSiteType.test.ts +129 -0
- package/Tests/Types/SerializableObjectDictionary.test.ts +166 -0
- package/Tests/Types/Time/RangeStartAndEndDateTime.test.ts +98 -0
- package/Tests/Types/WebsiteRequest.test.ts +230 -0
- package/Tests/UI/Components/EntityFilterRoundTrip.test.tsx +103 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableUrlState.test.tsx +612 -0
- package/Tests/UI/Components/ModelTable/FilterDataToQuery.test.ts +275 -0
- package/Tests/UI/Utils/LogExport.test.ts +159 -0
- package/Tests/UI/Utils/Navigation.test.ts +183 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +539 -0
- package/Tests/UI/Utils/TableViewUrlState.test.ts +272 -0
- package/Tests/Utils/Base64.test.ts +51 -0
- package/Tests/Utils/Boolean.test.ts +76 -0
- package/Tests/Utils/Crypto.test.ts +48 -0
- package/Tests/Utils/Dashboard/DashboardSloComponent.test.ts +259 -0
- package/Tests/Utils/Dashboard/ModelQueryVariableInterpolation.test.ts +162 -0
- package/Tests/Utils/Enum.test.ts +54 -0
- package/Tests/Utils/IpCanonicalUtil.test.ts +85 -0
- package/Tests/Utils/Memory.test.ts +44 -0
- package/Tests/Utils/Metrics/MetricSeriesFingerprint.test.ts +160 -0
- package/Tests/Utils/Monitor/EndpointAttachmentUtil.test.ts +836 -0
- package/Tests/Utils/Monitor/MonitorMetricType.test.ts +218 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +447 -0
- package/Tests/Utils/NetworkSite/CidrMatchUtil.test.ts +440 -0
- package/Tests/Utils/NetworkSite/MaterializedPathUtil.test.ts +205 -0
- package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +221 -0
- package/Tests/Utils/NetworkSite/SiteUptimeUtil.test.ts +283 -0
- package/Tests/Utils/ObjectUtil.test.ts +30 -0
- package/Tests/Utils/Slo/SloBurnRateRuleState.test.ts +124 -0
- package/Tests/Utils/Slo/SloDuration.test.ts +148 -0
- package/Tests/Utils/Slo/SloHealth.test.ts +334 -0
- package/Tests/Utils/Slo/SloStatusColor.test.ts +89 -0
- package/Tests/Utils/Slo/SloUtil.test.ts +1980 -0
- package/Tests/Utils/Slo/SloWidgetFormat.test.ts +605 -0
- package/Tests/Utils/TechStack.test.ts +50 -0
- package/Tests/Utils/Traces/CriticalPath.test.ts +178 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +10 -0
- package/Types/BaseDatabase/EqualTo.ts +9 -1
- package/Types/BaseDatabase/EqualToOrNull.ts +9 -1
- package/Types/BaseDatabase/NotEqual.ts +9 -1
- package/Types/Dashboard/DashboardComponentType.ts +1 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardSloComponent.ts +42 -0
- package/Types/Dashboard/DashboardTemplates.ts +214 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/Kubernetes/KubernetesCostIngest.ts +79 -0
- package/Types/Monitor/CriteriaFilter.ts +9 -0
- package/Types/Monitor/MonitorStep.ts +5 -8
- package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +27 -5
- package/Types/Monitor/MonitorType.ts +15 -5
- package/Types/Monitor/SnmpMonitor/ArpEntry.ts +14 -0
- package/Types/Monitor/SnmpMonitor/FdbEntry.ts +18 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +10 -3
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +31 -5
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +12 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +231 -3
- package/Types/NetworkSite/DefaultNetworkSiteType.ts +20 -0
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/Permission.ts +449 -0
- package/Types/ServiceLevelObjective/SliType.ts +6 -0
- package/Types/ServiceLevelObjective/SloMultiMonitorMode.ts +6 -0
- package/Types/ServiceLevelObjective/SloStatus.ts +9 -0
- package/Types/ServiceLevelObjective/SloWindowType.ts +6 -0
- package/Types/Telemetry/ServiceType.ts +1 -0
- package/UI/Components/Filters/EntityFilter.tsx +16 -0
- package/UI/Components/Filters/FilterViewer.tsx +22 -5
- package/UI/Components/List/List.tsx +8 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +309 -106
- package/UI/Components/ModelTable/FilterDataToQuery.ts +172 -0
- package/UI/Components/Navbar/NavBar.tsx +16 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +3 -3
- package/UI/Utils/Navigation.ts +10 -0
- package/UI/Utils/TableFilterUrlState.ts +204 -17
- package/UI/Utils/TableViewUrlState.ts +165 -0
- package/Utils/Dashboard/Components/DashboardSloComponent.ts +114 -0
- package/Utils/Dashboard/Components/Index.ts +7 -0
- package/Utils/IpCanonicalUtil.ts +134 -0
- package/Utils/Monitor/EndpointAttachmentUtil.ts +508 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +157 -5
- package/Utils/NetworkSite/CidrMatchUtil.ts +296 -0
- package/Utils/NetworkSite/MaterializedPathUtil.ts +115 -0
- package/Utils/NetworkSite/SiteStatusRollupUtil.ts +97 -0
- package/Utils/NetworkSite/SiteUptimeUtil.ts +111 -0
- package/Utils/Slo/SloBurnRateRuleState.ts +91 -0
- package/Utils/Slo/SloDuration.ts +165 -0
- package/Utils/Slo/SloEvaluation.ts +22 -0
- package/Utils/Slo/SloHealth.ts +302 -0
- package/Utils/Slo/SloStatusColor.ts +54 -0
- package/Utils/Slo/SloUtil.ts +637 -0
- package/Utils/Slo/SloWidgetFormat.ts +383 -0
- package/build/dist/Models/AnalyticsModels/Index.js +4 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +713 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js +44 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/SloHistory.js +218 -0
- package/build/dist/Models/AnalyticsModels/SloHistory.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +20 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +458 -6
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +0 -6
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkEndpoint.js +779 -0
- package/build/dist/Models/DatabaseModels/NetworkEndpoint.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js +1180 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js +534 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteLink.js +629 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteLink.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js +538 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js +522 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js +1134 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +769 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js +460 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js +459 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.js +130 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.js +31 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.js +36 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.js +49 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.js +140 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.js +21 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +23 -6
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +24 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/KubernetesCostAllocationService.js +12 -0
- package/build/dist/Server/Services/KubernetesCostAllocationService.js.map +1 -0
- package/build/dist/Server/Services/MetricService.js +21 -3
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +19 -0
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +351 -1
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkEndpointService.js +319 -0
- package/build/dist/Server/Services/NetworkEndpointService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteAssignmentRuleService.js +90 -0
- package/build/dist/Server/Services/NetworkSiteAssignmentRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteLinkService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteLinkService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteService.js +1038 -0
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteStatusTimelineService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteStatusTimelineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteTypeService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteTypeService.js.map +1 -0
- package/build/dist/Server/Services/ProjectService.js +98 -2
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js +358 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js +9 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js +588 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js.map +1 -0
- package/build/dist/Server/Services/SloHistoryService.js +77 -0
- package/build/dist/Server/Services/SloHistoryService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js +20 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +9 -0
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +15 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +31 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +76 -48
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Memory.js +9 -1
- package/build/dist/Server/Utils/Memory.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +132 -10
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Data/OuiVendors.json +6920 -0
- package/build/dist/Server/Utils/Monitor/DnsResolutionCache.js +77 -0
- package/build/dist/Server/Utils/Monitor/DnsResolutionCache.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +21 -41
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +152 -40
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +262 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +201 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +152 -120
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/OuiLookupUtil.js +44 -0
- package/build/dist/Server/Utils/Monitor/OuiLookupUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +10 -10
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -1
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +5 -0
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +10 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/EqualTo.js +9 -1
- package/build/dist/Types/BaseDatabase/EqualTo.js.map +1 -1
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js +9 -1
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js.map +1 -1
- package/build/dist/Types/BaseDatabase/NotEqual.js +9 -1
- package/build/dist/Types/BaseDatabase/NotEqual.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloComponent.js +23 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +205 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js +21 -0
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +5 -5
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +8 -0
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +15 -5
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/ArpEntry.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/ArpEntry.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/FdbEntry.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/FdbEntry.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +9 -3
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +217 -3
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteType.js +21 -0
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteType.js.map +1 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/Permission.js +409 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/ServiceLevelObjective/SliType.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SliType.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloMultiMonitorMode.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SloMultiMonitorMode.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloStatus.js +10 -0
- package/build/dist/Types/ServiceLevelObjective/SloStatus.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloWindowType.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SloWindowType.js.map +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/UI/Components/Filters/EntityFilter.js +15 -0
- package/build/dist/UI/Components/Filters/EntityFilter.js.map +1 -1
- package/build/dist/UI/Components/Filters/FilterViewer.js +19 -4
- package/build/dist/UI/Components/Filters/FilterViewer.js.map +1 -1
- package/build/dist/UI/Components/List/List.js +1 -1
- package/build/dist/UI/Components/List/List.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +235 -89
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/FilterDataToQuery.js +96 -0
- package/build/dist/UI/Components/ModelTable/FilterDataToQuery.js.map +1 -0
- package/build/dist/UI/Components/Navbar/NavBar.js +14 -2
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +3 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +9 -0
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/TableFilterUrlState.js +159 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/UI/Utils/TableViewUrlState.js +103 -0
- package/build/dist/UI/Utils/TableViewUrlState.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js +93 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/IpCanonicalUtil.js +110 -0
- package/build/dist/Utils/IpCanonicalUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/EndpointAttachmentUtil.js +311 -0
- package/build/dist/Utils/Monitor/EndpointAttachmentUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +98 -5
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkSite/CidrMatchUtil.js +222 -0
- package/build/dist/Utils/NetworkSite/CidrMatchUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/MaterializedPathUtil.js +89 -0
- package/build/dist/Utils/NetworkSite/MaterializedPathUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +60 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js +76 -0
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js.map +1 -0
- package/build/dist/Utils/Slo/SloBurnRateRuleState.js +35 -0
- package/build/dist/Utils/Slo/SloBurnRateRuleState.js.map +1 -0
- package/build/dist/Utils/Slo/SloDuration.js +87 -0
- package/build/dist/Utils/Slo/SloDuration.js.map +1 -0
- package/build/dist/Utils/Slo/SloEvaluation.js +21 -0
- package/build/dist/Utils/Slo/SloEvaluation.js.map +1 -0
- package/build/dist/Utils/Slo/SloHealth.js +179 -0
- package/build/dist/Utils/Slo/SloHealth.js.map +1 -0
- package/build/dist/Utils/Slo/SloStatusColor.js +18 -0
- package/build/dist/Utils/Slo/SloStatusColor.js.map +1 -0
- package/build/dist/Utils/Slo/SloUtil.js +393 -0
- package/build/dist/Utils/Slo/SloUtil.js.map +1 -0
- package/build/dist/Utils/Slo/SloWidgetFormat.js +174 -0
- package/build/dist/Utils/Slo/SloWidgetFormat.js.map +1 -0
- package/package.json +2 -2
- package/Types/Dashboard/DashboardComponents/Index.ts +0 -7
- package/build/dist/Types/Dashboard/DashboardComponents/Index.js +0 -8
- package/build/dist/Types/Dashboard/DashboardComponents/Index.js.map +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDurationCompact,
|
|
3
|
+
formatErrorBudgetRemaining,
|
|
4
|
+
formatErrorBudgetRemainingOfTotal,
|
|
5
|
+
} from "../../../Utils/Slo/SloDuration";
|
|
6
|
+
|
|
7
|
+
const MINUS_SIGN: string = "−";
|
|
8
|
+
|
|
9
|
+
describe("SloDuration", () => {
|
|
10
|
+
describe("formatDurationCompact", () => {
|
|
11
|
+
it("renders seconds under a minute", () => {
|
|
12
|
+
expect(formatDurationCompact(45)).toBe("45s");
|
|
13
|
+
expect(formatDurationCompact(1)).toBe("1s");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("renders zero as 0s rather than an empty string", () => {
|
|
17
|
+
expect(formatDurationCompact(0)).toBe("0s");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("renders minutes and seconds", () => {
|
|
21
|
+
// 99.9% over 30 days — the canonical error budget.
|
|
22
|
+
expect(formatDurationCompact(2592)).toBe("43m 12s");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("drops a zero remainder instead of padding it", () => {
|
|
26
|
+
expect(formatDurationCompact(120)).toBe("2m");
|
|
27
|
+
expect(formatDurationCompact(7200)).toBe("2h");
|
|
28
|
+
expect(formatDurationCompact(172800)).toBe("2d");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("renders hours and minutes", () => {
|
|
32
|
+
// 99% over 90 days.
|
|
33
|
+
expect(formatDurationCompact(77760)).toBe("21h 36m");
|
|
34
|
+
expect(formatDurationCompact(7860)).toBe("2h 11m");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("renders days and hours", () => {
|
|
38
|
+
expect(formatDurationCompact(190800)).toBe("2d 5h");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("shows at most the two most significant units", () => {
|
|
42
|
+
// 2d 5h 13m 7s — the minutes and seconds are dropped.
|
|
43
|
+
expect(formatDurationCompact(191587)).toBe("2d 5h");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("skips leading zero units", () => {
|
|
47
|
+
// 0d 0h 5m 3s.
|
|
48
|
+
expect(formatDurationCompact(303)).toBe("5m 3s");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("skips an interior zero unit and moves on to the next", () => {
|
|
52
|
+
/*
|
|
53
|
+
* Exactly 2 days + 30 seconds: hours and minutes are both zero, so
|
|
54
|
+
* the second slot is filled by seconds rather than padded with "0h".
|
|
55
|
+
*/
|
|
56
|
+
expect(formatDurationCompact(172830)).toBe("2d 30s");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("floors fractional seconds instead of rounding up", () => {
|
|
60
|
+
// A 59.9s budget must never read as a full minute it does not have.
|
|
61
|
+
expect(formatDurationCompact(59.9)).toBe("59s");
|
|
62
|
+
expect(formatDurationCompact(0.4)).toBe("0s");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("renders the magnitude of a negative input (sign is the caller's job)", () => {
|
|
66
|
+
expect(formatDurationCompact(-2592)).toBe("43m 12s");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe("formatErrorBudgetRemaining", () => {
|
|
71
|
+
it("labels a positive remainder as left", () => {
|
|
72
|
+
expect(formatErrorBudgetRemaining(2592)).toBe("43m 12s left");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("renders an exhausted-but-not-overspent budget as 0s left", () => {
|
|
76
|
+
expect(formatErrorBudgetRemaining(0)).toBe("0s left");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("renders an overspent budget with a minus sign and over budget", () => {
|
|
80
|
+
expect(formatErrorBudgetRemaining(-750)).toBe(
|
|
81
|
+
`${MINUS_SIGN}12m 30s over budget`,
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("returns null when the SLO has not been evaluated", () => {
|
|
86
|
+
expect(formatErrorBudgetRemaining(null)).toBeNull();
|
|
87
|
+
expect(formatErrorBudgetRemaining(undefined)).toBeNull();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("returns null for non-finite values", () => {
|
|
91
|
+
expect(formatErrorBudgetRemaining(Number.NaN)).toBeNull();
|
|
92
|
+
expect(formatErrorBudgetRemaining(Number.POSITIVE_INFINITY)).toBeNull();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("rejects a numeric string rather than coercing it", () => {
|
|
96
|
+
expect(
|
|
97
|
+
formatErrorBudgetRemaining("2592" as unknown as number),
|
|
98
|
+
).toBeNull();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe("formatErrorBudgetRemainingOfTotal", () => {
|
|
103
|
+
it("renders remaining alongside the total", () => {
|
|
104
|
+
expect(
|
|
105
|
+
formatErrorBudgetRemainingOfTotal({
|
|
106
|
+
remainingSeconds: 750,
|
|
107
|
+
totalSeconds: 2592,
|
|
108
|
+
}),
|
|
109
|
+
).toBe("12m 30s left of 43m 12s");
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("keeps the total visible when the budget is overspent", () => {
|
|
113
|
+
expect(
|
|
114
|
+
formatErrorBudgetRemainingOfTotal({
|
|
115
|
+
remainingSeconds: -750,
|
|
116
|
+
totalSeconds: 2592,
|
|
117
|
+
}),
|
|
118
|
+
).toBe(`${MINUS_SIGN}12m 30s over budget of 43m 12s`);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("omits the total when it is unknown", () => {
|
|
122
|
+
expect(
|
|
123
|
+
formatErrorBudgetRemainingOfTotal({
|
|
124
|
+
remainingSeconds: 750,
|
|
125
|
+
totalSeconds: null,
|
|
126
|
+
}),
|
|
127
|
+
).toBe("12m 30s left");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("omits a zero total — a brand-new SLO has no elapsed window yet", () => {
|
|
131
|
+
expect(
|
|
132
|
+
formatErrorBudgetRemainingOfTotal({
|
|
133
|
+
remainingSeconds: 0,
|
|
134
|
+
totalSeconds: 0,
|
|
135
|
+
}),
|
|
136
|
+
).toBe("0s left");
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("returns null when the SLO has not been evaluated", () => {
|
|
140
|
+
expect(
|
|
141
|
+
formatErrorBudgetRemainingOfTotal({
|
|
142
|
+
remainingSeconds: null,
|
|
143
|
+
totalSeconds: 2592,
|
|
144
|
+
}),
|
|
145
|
+
).toBeNull();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import SliType from "../../../Types/ServiceLevelObjective/SliType";
|
|
2
|
+
import SloMultiMonitorMode from "../../../Types/ServiceLevelObjective/SloMultiMonitorMode";
|
|
3
|
+
import SloStatus from "../../../Types/ServiceLevelObjective/SloStatus";
|
|
4
|
+
import SloWindowType from "../../../Types/ServiceLevelObjective/SloWindowType";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_AT_RISK_THRESHOLD_PERCENTAGE,
|
|
7
|
+
getSloBudgetTier,
|
|
8
|
+
getSloNotice,
|
|
9
|
+
isRollingWindowNotYetFull,
|
|
10
|
+
SloBudgetTier,
|
|
11
|
+
SloNotice,
|
|
12
|
+
SloNoticeType,
|
|
13
|
+
} from "../../../Utils/Slo/SloHealth";
|
|
14
|
+
|
|
15
|
+
const SECONDS_PER_DAY: number = 24 * 60 * 60;
|
|
16
|
+
|
|
17
|
+
/** The full 30-day error budget of a 99.9% SLO: 43m 12s. */
|
|
18
|
+
const THIRTY_DAY_999_BUDGET_SECONDS: number = 0.001 * 30 * SECONDS_PER_DAY;
|
|
19
|
+
|
|
20
|
+
describe("SloHealth", () => {
|
|
21
|
+
describe("getSloBudgetTier", () => {
|
|
22
|
+
it("returns Unknown when the SLO has not been evaluated", () => {
|
|
23
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: null })).toBe(
|
|
24
|
+
SloBudgetTier.Unknown,
|
|
25
|
+
);
|
|
26
|
+
expect(
|
|
27
|
+
getSloBudgetTier({ errorBudgetRemainingPercentage: undefined }),
|
|
28
|
+
).toBe(SloBudgetTier.Unknown);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("returns Unknown for non-finite values", () => {
|
|
32
|
+
expect(
|
|
33
|
+
getSloBudgetTier({ errorBudgetRemainingPercentage: Number.NaN }),
|
|
34
|
+
).toBe(SloBudgetTier.Unknown);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("returns Healthy well above the threshold", () => {
|
|
38
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: 68 })).toBe(
|
|
39
|
+
SloBudgetTier.Healthy,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("returns Exhausted at exactly zero", () => {
|
|
44
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: 0 })).toBe(
|
|
45
|
+
SloBudgetTier.Exhausted,
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("returns Exhausted when overspent", () => {
|
|
50
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: -37 })).toBe(
|
|
51
|
+
SloBudgetTier.Exhausted,
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("returns AtRisk at exactly the threshold", () => {
|
|
56
|
+
expect(
|
|
57
|
+
getSloBudgetTier({
|
|
58
|
+
errorBudgetRemainingPercentage: DEFAULT_AT_RISK_THRESHOLD_PERCENTAGE,
|
|
59
|
+
}),
|
|
60
|
+
).toBe(SloBudgetTier.AtRisk);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("falls back to the 20% default when no threshold is given", () => {
|
|
64
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: 19.9 })).toBe(
|
|
65
|
+
SloBudgetTier.AtRisk,
|
|
66
|
+
);
|
|
67
|
+
expect(getSloBudgetTier({ errorBudgetRemainingPercentage: 20.1 })).toBe(
|
|
68
|
+
SloBudgetTier.Healthy,
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("honours a custom at-risk threshold instead of the hardcoded 20", () => {
|
|
73
|
+
/*
|
|
74
|
+
* The regression this function exists for: at a 50% threshold the
|
|
75
|
+
* old `remaining <= 20` check rendered 35% green while the worker
|
|
76
|
+
* had already moved the SLO to At Risk.
|
|
77
|
+
*/
|
|
78
|
+
expect(
|
|
79
|
+
getSloBudgetTier({
|
|
80
|
+
errorBudgetRemainingPercentage: 35,
|
|
81
|
+
atRiskThresholdPercentage: 50,
|
|
82
|
+
}),
|
|
83
|
+
).toBe(SloBudgetTier.AtRisk);
|
|
84
|
+
|
|
85
|
+
expect(
|
|
86
|
+
getSloBudgetTier({
|
|
87
|
+
errorBudgetRemainingPercentage: 15,
|
|
88
|
+
atRiskThresholdPercentage: 5,
|
|
89
|
+
}),
|
|
90
|
+
).toBe(SloBudgetTier.Healthy);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("treats a zero threshold as 'at risk only once exhausted'", () => {
|
|
94
|
+
expect(
|
|
95
|
+
getSloBudgetTier({
|
|
96
|
+
errorBudgetRemainingPercentage: 0.5,
|
|
97
|
+
atRiskThresholdPercentage: 0,
|
|
98
|
+
}),
|
|
99
|
+
).toBe(SloBudgetTier.Healthy);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("getSloNotice", () => {
|
|
104
|
+
it("returns null for a normally measuring SLO", () => {
|
|
105
|
+
expect(
|
|
106
|
+
getSloNotice({
|
|
107
|
+
isEnabled: true,
|
|
108
|
+
sloStatus: SloStatus.Healthy,
|
|
109
|
+
sliType: SliType.MonitorUptime,
|
|
110
|
+
monitorCount: 2,
|
|
111
|
+
targetPercentage: 99.9,
|
|
112
|
+
lastEvaluatedAt: new Date(),
|
|
113
|
+
}),
|
|
114
|
+
).toBeNull();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("reports a disabled SLO ahead of any other reason", () => {
|
|
118
|
+
/*
|
|
119
|
+
* A disabled SLO is never evaluated, so its stale Misconfigured
|
|
120
|
+
* status must not send the user off to attach monitors.
|
|
121
|
+
*/
|
|
122
|
+
const notice: SloNotice | null = getSloNotice({
|
|
123
|
+
isEnabled: false,
|
|
124
|
+
sloStatus: SloStatus.Misconfigured,
|
|
125
|
+
monitorCount: 0,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
expect(notice?.type).toBe(SloNoticeType.Info);
|
|
129
|
+
expect(notice?.title).toBe("This SLO is disabled");
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("names 'no monitors' as the reason for Misconfigured", () => {
|
|
133
|
+
const notice: SloNotice | null = getSloNotice({
|
|
134
|
+
isEnabled: true,
|
|
135
|
+
sloStatus: SloStatus.Misconfigured,
|
|
136
|
+
sliType: SliType.MonitorUptime,
|
|
137
|
+
monitorCount: 0,
|
|
138
|
+
targetPercentage: 99.9,
|
|
139
|
+
lastEvaluatedAt: new Date(),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
expect(notice?.type).toBe(SloNoticeType.Warning);
|
|
143
|
+
expect(notice?.title).toBe("No monitors attached");
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("names an out-of-range target as the reason for Misconfigured", () => {
|
|
147
|
+
const notice: SloNotice | null = getSloNotice({
|
|
148
|
+
isEnabled: true,
|
|
149
|
+
sloStatus: SloStatus.Misconfigured,
|
|
150
|
+
sliType: SliType.MonitorUptime,
|
|
151
|
+
monitorCount: 1,
|
|
152
|
+
targetPercentage: 100,
|
|
153
|
+
lastEvaluatedAt: new Date(),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
expect(notice?.title).toBe("The target is out of range");
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("names an unsupported SLI type ahead of the monitor count", () => {
|
|
160
|
+
const notice: SloNotice | null = getSloNotice({
|
|
161
|
+
isEnabled: true,
|
|
162
|
+
sloStatus: SloStatus.Misconfigured,
|
|
163
|
+
sliType: SliType.Metric,
|
|
164
|
+
monitorCount: 0,
|
|
165
|
+
targetPercentage: 99.9,
|
|
166
|
+
lastEvaluatedAt: new Date(),
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
expect(notice?.body).toContain(SliType.MonitorUptime);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("falls back to a generic reason for Misconfigured", () => {
|
|
173
|
+
const notice: SloNotice | null = getSloNotice({
|
|
174
|
+
isEnabled: true,
|
|
175
|
+
sloStatus: SloStatus.Misconfigured,
|
|
176
|
+
sliType: SliType.MonitorUptime,
|
|
177
|
+
monitorCount: 1,
|
|
178
|
+
targetPercentage: 99.9,
|
|
179
|
+
lastEvaluatedAt: new Date(),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
expect(notice?.title).toBe("This SLO cannot be evaluated");
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("explains Paused", () => {
|
|
186
|
+
const notice: SloNotice | null = getSloNotice({
|
|
187
|
+
isEnabled: true,
|
|
188
|
+
sloStatus: SloStatus.Paused,
|
|
189
|
+
sliType: SliType.MonitorUptime,
|
|
190
|
+
monitorCount: 2,
|
|
191
|
+
targetPercentage: 99.9,
|
|
192
|
+
lastEvaluatedAt: new Date(),
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
expect(notice?.type).toBe(SloNoticeType.Info);
|
|
196
|
+
expect(notice?.title).toBe("Measurement is paused");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("explains a never-evaluated SLO", () => {
|
|
200
|
+
const notice: SloNotice | null = getSloNotice({
|
|
201
|
+
isEnabled: true,
|
|
202
|
+
sloStatus: SloStatus.Healthy,
|
|
203
|
+
sliType: SliType.MonitorUptime,
|
|
204
|
+
monitorCount: 1,
|
|
205
|
+
targetPercentage: 99.9,
|
|
206
|
+
lastEvaluatedAt: null,
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
expect(notice?.title).toBe("Not evaluated yet");
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it("says nothing about a healthy SLO whose isEnabled was not selected", () => {
|
|
213
|
+
// `undefined` means "not loaded", which is not the same as `false`.
|
|
214
|
+
expect(
|
|
215
|
+
getSloNotice({
|
|
216
|
+
sloStatus: SloStatus.Healthy,
|
|
217
|
+
sliType: SliType.MonitorUptime,
|
|
218
|
+
monitorCount: 1,
|
|
219
|
+
targetPercentage: 99.9,
|
|
220
|
+
lastEvaluatedAt: new Date(),
|
|
221
|
+
}),
|
|
222
|
+
).toBeNull();
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe("isRollingWindowNotYetFull", () => {
|
|
227
|
+
it("is false for a mature rolling window", () => {
|
|
228
|
+
expect(
|
|
229
|
+
isRollingWindowNotYetFull({
|
|
230
|
+
windowType: SloWindowType.Rolling,
|
|
231
|
+
windowDays: 30,
|
|
232
|
+
targetPercentage: 99.9,
|
|
233
|
+
errorBudgetTotalSeconds: THIRTY_DAY_999_BUDGET_SECONDS,
|
|
234
|
+
}),
|
|
235
|
+
).toBe(false);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it("is true for a 30-day SLO carrying only a week of data", () => {
|
|
239
|
+
expect(
|
|
240
|
+
isRollingWindowNotYetFull({
|
|
241
|
+
windowType: SloWindowType.Rolling,
|
|
242
|
+
windowDays: 30,
|
|
243
|
+
targetPercentage: 99.9,
|
|
244
|
+
errorBudgetTotalSeconds: 0.001 * 7 * SECONDS_PER_DAY,
|
|
245
|
+
}),
|
|
246
|
+
).toBe(true);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("stays silent for Monitor Seconds Average — its budget scales with the monitor count", () => {
|
|
250
|
+
/*
|
|
251
|
+
* A five-monitor SLO with a week of data carries 35 monitor-days of
|
|
252
|
+
* budget, which would read as mature against a 30-day yardstick. The
|
|
253
|
+
* helper declines to guess rather than answer wrongly in either
|
|
254
|
+
* direction.
|
|
255
|
+
*/
|
|
256
|
+
expect(
|
|
257
|
+
isRollingWindowNotYetFull({
|
|
258
|
+
windowType: SloWindowType.Rolling,
|
|
259
|
+
windowDays: 30,
|
|
260
|
+
targetPercentage: 99.9,
|
|
261
|
+
errorBudgetTotalSeconds: 0.001 * 7 * SECONDS_PER_DAY,
|
|
262
|
+
multiMonitorMode: SloMultiMonitorMode.MonitorSecondsAverage,
|
|
263
|
+
}),
|
|
264
|
+
).toBe(false);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("still answers for the default Any Monitor Down mode", () => {
|
|
268
|
+
expect(
|
|
269
|
+
isRollingWindowNotYetFull({
|
|
270
|
+
windowType: SloWindowType.Rolling,
|
|
271
|
+
windowDays: 30,
|
|
272
|
+
targetPercentage: 99.9,
|
|
273
|
+
errorBudgetTotalSeconds: 0.001 * 7 * SECONDS_PER_DAY,
|
|
274
|
+
multiMonitorMode: SloMultiMonitorMode.AnyDown,
|
|
275
|
+
}),
|
|
276
|
+
).toBe(true);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it("tolerates the small shortfall between now and the last evaluation", () => {
|
|
280
|
+
// 0.5% short — a mature SLO must not flicker the banner.
|
|
281
|
+
expect(
|
|
282
|
+
isRollingWindowNotYetFull({
|
|
283
|
+
windowType: SloWindowType.Rolling,
|
|
284
|
+
windowDays: 30,
|
|
285
|
+
targetPercentage: 99.9,
|
|
286
|
+
errorBudgetTotalSeconds: THIRTY_DAY_999_BUDGET_SECONDS * 0.995,
|
|
287
|
+
}),
|
|
288
|
+
).toBe(false);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("is false for calendar-month windows — their budget is never prorated", () => {
|
|
292
|
+
expect(
|
|
293
|
+
isRollingWindowNotYetFull({
|
|
294
|
+
windowType: SloWindowType.CalendarMonth,
|
|
295
|
+
windowDays: 30,
|
|
296
|
+
targetPercentage: 99.9,
|
|
297
|
+
errorBudgetTotalSeconds: 1,
|
|
298
|
+
}),
|
|
299
|
+
).toBe(false);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("is false when the SLO has not been evaluated", () => {
|
|
303
|
+
expect(
|
|
304
|
+
isRollingWindowNotYetFull({
|
|
305
|
+
windowType: SloWindowType.Rolling,
|
|
306
|
+
windowDays: 30,
|
|
307
|
+
targetPercentage: 99.9,
|
|
308
|
+
errorBudgetTotalSeconds: null,
|
|
309
|
+
}),
|
|
310
|
+
).toBe(false);
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
it("is false when the target would make the full-window budget meaningless", () => {
|
|
314
|
+
expect(
|
|
315
|
+
isRollingWindowNotYetFull({
|
|
316
|
+
windowType: SloWindowType.Rolling,
|
|
317
|
+
windowDays: 30,
|
|
318
|
+
targetPercentage: 100,
|
|
319
|
+
errorBudgetTotalSeconds: 60,
|
|
320
|
+
}),
|
|
321
|
+
).toBe(false);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it("defaults windowDays to 30 when it is not set", () => {
|
|
325
|
+
expect(
|
|
326
|
+
isRollingWindowNotYetFull({
|
|
327
|
+
windowType: SloWindowType.Rolling,
|
|
328
|
+
targetPercentage: 99.9,
|
|
329
|
+
errorBudgetTotalSeconds: 0.001 * 7 * SECONDS_PER_DAY,
|
|
330
|
+
}),
|
|
331
|
+
).toBe(true);
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Gray500, Green, Red, Yellow } from "../../../Types/BrandColors";
|
|
2
|
+
import Color from "../../../Types/Color";
|
|
3
|
+
import SloStatus from "../../../Types/ServiceLevelObjective/SloStatus";
|
|
4
|
+
import {
|
|
5
|
+
getSloStatusColor,
|
|
6
|
+
getSloStatusText,
|
|
7
|
+
} from "../../../Utils/Slo/SloStatusColor";
|
|
8
|
+
|
|
9
|
+
describe("SloStatusColor", () => {
|
|
10
|
+
describe("getSloStatusColor", () => {
|
|
11
|
+
it("colours a healthy SLO green", () => {
|
|
12
|
+
expect(getSloStatusColor(SloStatus.Healthy).toString()).toBe(
|
|
13
|
+
Green.toString(),
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("colours an at-risk SLO yellow", () => {
|
|
18
|
+
expect(getSloStatusColor(SloStatus.AtRisk).toString()).toBe(
|
|
19
|
+
Yellow.toString(),
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("colours an exhausted error budget red", () => {
|
|
24
|
+
expect(getSloStatusColor(SloStatus.BudgetExhausted).toString()).toBe(
|
|
25
|
+
Red.toString(),
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("colours a misconfigured SLO gray because there is nothing to measure", () => {
|
|
30
|
+
expect(getSloStatusColor(SloStatus.Misconfigured).toString()).toBe(
|
|
31
|
+
Gray500.toString(),
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("colours a paused SLO gray because it is deliberately not measured", () => {
|
|
36
|
+
expect(getSloStatusColor(SloStatus.Paused).toString()).toBe(
|
|
37
|
+
Gray500.toString(),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("colours an unset status gray rather than claiming a health colour", () => {
|
|
42
|
+
expect(getSloStatusColor(undefined).toString()).toBe(Gray500.toString());
|
|
43
|
+
expect(getSloStatusColor(null).toString()).toBe(Gray500.toString());
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("colours an unrecognised persisted status gray", () => {
|
|
47
|
+
expect(getSloStatusColor("Something New" as SloStatus).toString()).toBe(
|
|
48
|
+
Gray500.toString(),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("returns a colour for every member of the SloStatus enum", () => {
|
|
53
|
+
for (const status of Object.values(SloStatus)) {
|
|
54
|
+
const color: Color = getSloStatusColor(status);
|
|
55
|
+
|
|
56
|
+
expect(color).toBeInstanceOf(Color);
|
|
57
|
+
expect(color.toString()).toMatch(/^#[0-9a-fA-F]{6}$/);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("only ever uses the four brand colours the SLO pages use", () => {
|
|
62
|
+
const allowed: Array<string> = [
|
|
63
|
+
Green.toString(),
|
|
64
|
+
Yellow.toString(),
|
|
65
|
+
Red.toString(),
|
|
66
|
+
Gray500.toString(),
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
for (const status of Object.values(SloStatus)) {
|
|
70
|
+
expect(allowed).toContain(getSloStatusColor(status).toString());
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("getSloStatusText", () => {
|
|
76
|
+
it.each(Object.values(SloStatus))(
|
|
77
|
+
"passes the %s status through unchanged",
|
|
78
|
+
(status: SloStatus) => {
|
|
79
|
+
expect(getSloStatusText(status)).toBe(status);
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
it("labels an unevaluated SLO Unknown rather than defaulting to Healthy", () => {
|
|
84
|
+
expect(getSloStatusText(undefined)).toBe("Unknown");
|
|
85
|
+
expect(getSloStatusText(null)).toBe("Unknown");
|
|
86
|
+
expect(getSloStatusText(undefined)).not.toBe(SloStatus.Healthy);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|