forked from google/jsonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrealistic2.jsonnet
105 lines (94 loc) · 2.21 KB
/
realistic2.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
local rfc3339(timestamp) = '1970-01-01T00:00:00Z';
local name1(a, b, c) =
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%sBBBBBBB%sCCCCCCCCCCC%s'
% [a, b, c];
local name2(x) =
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%s' % x;
local T1 = 'PPPPPPPPPPPPPPPPPPPPPPP';
local T2 = 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ';
local LOCATIONS = [
'europe-west1-b',
'europe-west1-c',
'europe-west1-d',
'europe-west2-a',
'europe-west2-b',
'europe-west2-c',
'europe-west3-a',
'europe-west3-b',
'europe-west3-c',
'europe-west4-a',
'europe-west4-b',
'europe-west4-c',
'us-central1-a',
'us-central1-b',
'us-central1-c',
'us-central1-f',
'us-east1-b',
'us-east1-c',
'us-east1-d',
'us-east4-a',
'us-east4-b',
'us-east4-c',
'us-west1-a',
'us-west1-b',
'us-west1-c',
];
// The return value is a function to allow it to be parameterized.
function(
timestamp=0,
x='xxxxxxxxxxxxxxxxxxx',
prefix='prefix',
num1=50,
count=25,
offset=0,
)
local rfc_timestamp = rfc3339(timestamp);
local func1(i) =
local location = LOCATIONS[i % std.length(LOCATIONS)];
[
local name = '%s-%000d-%000d' % [prefix, i, j];
{
field_zz1: rfc_timestamp,
fie_z2: {
field_z3: name1(x, location, name),
field_zzzzzzzzzz4: name2(x),
field_zzz5: [name],
field_z6: T1,
field_z7: location,
fi_8: '???',
fiel_z9: '99',
},
}
for j in std.range(0, num1 - 1)
];
local func2(i) =
local location = LOCATIONS[i % std.length(LOCATIONS)];
local all = [
name1(x, location, '%s-%000d-%000d' % [prefix, i, j])
for j in std.range(0, num1 - 1)
];
[
{
field_yy1: rfc_timestamp,
field_yyyyy2: 'EEEE',
field_yyyyy3: {
field_y4: T2,
field_yyyyyyy5: p,
field_yyyyyyy6: q,
},
}
for p in all
for q in all
if p != q
];
{
field_x1: '-----',
field_xxxxxxxxxxxxxxxx2: std.join([], [
func1(offset * count + i)
for i in std.range(0, count - 1)
]),
field_xxxxxxxxxxxxxxxxxxxxxx3: std.join([], [
func2(offset * count + i)
for i in std.range(0, count - 1)
]),
}