fix(map): показывать скорость сервисов по короткому окну IPFIX
Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 3s
Docker images / frontend-image (push) Successful in 2m14s
Docker images / updater-image (push) Successful in 39s
Docker images / netflow-agent-image (push) Successful in 31s
Docker images / backend-image (push) Successful in 15s
Docker images / publish-release (push) Successful in 11s
Docker images / notify-webhook (push) Successful in 2s
Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 3s
Docker images / frontend-image (push) Successful in 2m14s
Docker images / updater-image (push) Successful in 39s
Docker images / netflow-agent-image (push) Successful in 31s
Docker images / backend-image (push) Successful in 15s
Docker images / publish-release (push) Successful in 11s
Docker images / notify-webhook (push) Successful in 2s
This commit is contained in:
1 parent
ed7b1e0350
commit
c44bcd8f59
14 files changed
+261
-120
No files matched your search
@@ -27,11 +27,17 @@ export function validateNetworkMapSnapshot(servers:unknown,gre:unknown,probes:un
|
||||
|
||||
import {flowMapHopsDtoSchema} from "@mmapp/contracts/traffic-flow"
|
||||
import {isIpv4String} from "./gre-endpoint-resolve"
|
||||
export const networkMapFlowSchema = flowMapHopsDtoSchema.required().partial({ sourceWindow: true, interfaceTraffic: true, includesCurrentMinute: true, nodeUsers: true }).refine(data =>
|
||||
const mapFlowResponse = flowMapHopsDtoSchema.required().partial({ sourceWindow: true, interfaceTraffic: true, includesCurrentMinute: true, nodeUsers: true }).refine(data =>
|
||||
data.namedBytes <= data.totalBytes && data.unclassifiedBytes <= data.totalBytes
|
||||
)
|
||||
export const networkMapFlowSchema = mapFlowResponse.refine(data =>
|
||||
!data.includesCurrentMinute && data.windowSec === data.rangeMinutes * 60 && (data.sourceWindow
|
||||
? data.sourceWindow.requestedMinutes === 5 && data.sourceWindow.effectiveMinutes === data.rangeMinutes
|
||||
: data.rangeMinutes === 5) &&
|
||||
data.namedBytes <= data.totalBytes && data.unclassifiedBytes <= data.totalBytes
|
||||
: data.rangeMinutes === 5)
|
||||
)
|
||||
export const recentMapFlowSchema = mapFlowResponse.refine(data =>
|
||||
data.includesCurrentMinute === true && data.rangeMinutes === 1 && data.windowSec >= 60 && data.windowSec < 120 &&
|
||||
(!data.sourceWindow || data.sourceWindow.requestedMinutes === 1 && data.sourceWindow.effectiveMinutes === 1)
|
||||
)
|
||||
export function validateNetworkMapDns(raw:unknown,hosts:string[]){
|
||||
const data=z.object({results:z.record(z.string(),z.string().refine(isIpv4String).nullable())}).parse(raw)
|
||||
|
||||
Reference in new issue
Block a user