Update peering mocks

This commit is contained in:
Michael Klein 2022-10-13 10:36:12 +02:00
parent db4b38c36e
commit 4c2a5c31dc
3 changed files with 40 additions and 4 deletions

View File

@ -0,0 +1,31 @@
${[0].map(
() => {
let prevKind;
let name;
const gateways = ['mesh-gateway', 'ingress-gateway', 'terminating-gateway'];
return `
[
${
range(
env(
'CONSUL_SERVICE_COUNT',
Math.floor(
(
Math.random() * env('CONSUL_SERVICE_MAX', 10)
) + parseInt(env('CONSUL_SERVICE_MIN', 1))
)
)
).map(
function(item, i)
{
return `
{
"Name": "service-${i}"
}
`;
}
)
}
]
`})}

View File

@ -1,7 +1,5 @@
{
"ID": "${fake.random.uuid()}",
"ImportedServiceCount": ${fake.random.number({min: 0, max: 4000})},
"ExportedServiceCount": ${fake.random.number({min: 0, max: 4000})},
"Name": "${location.pathname.get(2)}",
"State": "${fake.helpers.randomize([
'ACTIVE',
@ -12,6 +10,13 @@
'TERMINATED',
'UNDEFINED'
])}",
"StreamStatus": {
"LastHeartbeat": "${fake.date.past(10).toISOString()}",
"LastReceive": "${fake.date.past(10).toISOString()}",
"LastSend": "${fake.date.past(10).toISOString()}",
"ExportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"exported-service-${i}"`)}],
"ImportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"imported-service-${i}"`)}]
},
"PeerID": "${fake.random.uuid()}",
"PeerServerName": "${fake.internet.domainName()}",
"PeerServerAddresses": [

View File

@ -22,8 +22,8 @@
"LastHeartbeat": "${fake.date.past(10).toISOString()}",
"LastReceive": "${fake.date.past(10).toISOString()}",
"LastSend": "${fake.date.past(10).toISOString()}",
"ExportedServices": ["${`export-service-${i}`}"],
"ImportedServices": ["${`import-service-${i}`}"]
"ExportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"exported-service-${i}"`)}],
"ImportedServices": [${range(0, Math.floor(Math.random() * 10)).map((i) => `"imported-service-${i}"`)}]
},
"PeerID": "${id}",
"PeerServerName": "${fake.internet.domainName()}",