|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | import { IndexPatternMapping } from '../types'; |
| 8 | +import { IndexPatternSavedObject } from '../../ml_popover/types'; |
8 | 9 |
|
9 | 10 | export const mockIndexPatternIds: IndexPatternMapping[] = [ |
10 | 11 | { title: 'filebeat-*', id: '8c7323ac-97ad-4b53-ac0a-40f8f691a918' }, |
11 | 12 | ]; |
12 | 13 |
|
| 14 | +export const mockAPMIndexPatternIds: IndexPatternMapping[] = [ |
| 15 | + { title: 'apm-*', id: '8c7323ac-97ad-4b53-ac0a-40f8f691a918' }, |
| 16 | +]; |
| 17 | + |
13 | 18 | export const mockSourceLayer = { |
14 | 19 | sourceDescriptor: { |
15 | 20 | id: 'uuid.v4()', |
@@ -113,6 +118,109 @@ export const mockDestinationLayer = { |
113 | 118 | query: { query: '', language: 'kuery' }, |
114 | 119 | }; |
115 | 120 |
|
| 121 | +export const mockClientLayer = { |
| 122 | + sourceDescriptor: { |
| 123 | + id: 'uuid.v4()', |
| 124 | + type: 'ES_SEARCH', |
| 125 | + applyGlobalQuery: true, |
| 126 | + geoField: 'client.geo.location', |
| 127 | + filterByMapBounds: false, |
| 128 | + tooltipProperties: [ |
| 129 | + 'host.name', |
| 130 | + 'client.ip', |
| 131 | + 'client.domain', |
| 132 | + 'client.geo.country_iso_code', |
| 133 | + 'client.as.organization.name', |
| 134 | + ], |
| 135 | + useTopHits: false, |
| 136 | + topHitsTimeField: '@timestamp', |
| 137 | + topHitsSize: 1, |
| 138 | + indexPatternId: '8c7323ac-97ad-4b53-ac0a-40f8f691a918', |
| 139 | + }, |
| 140 | + style: { |
| 141 | + type: 'VECTOR', |
| 142 | + properties: { |
| 143 | + fillColor: { |
| 144 | + type: 'STATIC', |
| 145 | + options: { color: '#6092C0' }, |
| 146 | + }, |
| 147 | + lineColor: { |
| 148 | + type: 'STATIC', |
| 149 | + options: { color: '#FFFFFF' }, |
| 150 | + }, |
| 151 | + lineWidth: { type: 'STATIC', options: { size: 2 } }, |
| 152 | + iconSize: { type: 'STATIC', options: { size: 8 } }, |
| 153 | + iconOrientation: { |
| 154 | + type: 'STATIC', |
| 155 | + options: { orientation: 0 }, |
| 156 | + }, |
| 157 | + symbol: { |
| 158 | + options: { symbolizeAs: 'icon', symbolId: 'home' }, |
| 159 | + }, |
| 160 | + }, |
| 161 | + }, |
| 162 | + id: 'uuid.v4()', |
| 163 | + label: `apm-* | Client Point`, |
| 164 | + minZoom: 0, |
| 165 | + maxZoom: 24, |
| 166 | + alpha: 1, |
| 167 | + visible: true, |
| 168 | + type: 'VECTOR', |
| 169 | + query: { query: '', language: 'kuery' }, |
| 170 | + joins: [], |
| 171 | +}; |
| 172 | + |
| 173 | +export const mockServerLayer = { |
| 174 | + sourceDescriptor: { |
| 175 | + id: 'uuid.v4()', |
| 176 | + type: 'ES_SEARCH', |
| 177 | + applyGlobalQuery: true, |
| 178 | + geoField: 'server.geo.location', |
| 179 | + filterByMapBounds: true, |
| 180 | + tooltipProperties: [ |
| 181 | + 'host.name', |
| 182 | + 'server.ip', |
| 183 | + 'server.domain', |
| 184 | + 'server.geo.country_iso_code', |
| 185 | + 'server.as.organization.name', |
| 186 | + ], |
| 187 | + useTopHits: false, |
| 188 | + topHitsTimeField: '@timestamp', |
| 189 | + topHitsSize: 1, |
| 190 | + indexPatternId: '8c7323ac-97ad-4b53-ac0a-40f8f691a918', |
| 191 | + }, |
| 192 | + style: { |
| 193 | + type: 'VECTOR', |
| 194 | + properties: { |
| 195 | + fillColor: { |
| 196 | + type: 'STATIC', |
| 197 | + options: { color: '#D36086' }, |
| 198 | + }, |
| 199 | + lineColor: { |
| 200 | + type: 'STATIC', |
| 201 | + options: { color: '#FFFFFF' }, |
| 202 | + }, |
| 203 | + lineWidth: { type: 'STATIC', options: { size: 2 } }, |
| 204 | + iconSize: { type: 'STATIC', options: { size: 8 } }, |
| 205 | + iconOrientation: { |
| 206 | + type: 'STATIC', |
| 207 | + options: { orientation: 0 }, |
| 208 | + }, |
| 209 | + symbol: { |
| 210 | + options: { symbolizeAs: 'icon', symbolId: 'marker' }, |
| 211 | + }, |
| 212 | + }, |
| 213 | + }, |
| 214 | + id: 'uuid.v4()', |
| 215 | + label: `apm-* | Server Point`, |
| 216 | + minZoom: 0, |
| 217 | + maxZoom: 24, |
| 218 | + alpha: 1, |
| 219 | + visible: true, |
| 220 | + type: 'VECTOR', |
| 221 | + query: { query: '', language: 'kuery' }, |
| 222 | +}; |
| 223 | + |
116 | 224 | export const mockLineLayer = { |
117 | 225 | sourceDescriptor: { |
118 | 226 | type: 'ES_PEW_PEW', |
@@ -173,6 +281,66 @@ export const mockLineLayer = { |
173 | 281 | query: { query: '', language: 'kuery' }, |
174 | 282 | }; |
175 | 283 |
|
| 284 | +export const mockClientServerLineLayer = { |
| 285 | + sourceDescriptor: { |
| 286 | + type: 'ES_PEW_PEW', |
| 287 | + applyGlobalQuery: true, |
| 288 | + id: 'uuid.v4()', |
| 289 | + indexPatternId: '8c7323ac-97ad-4b53-ac0a-40f8f691a918', |
| 290 | + sourceGeoField: 'client.geo.location', |
| 291 | + destGeoField: 'server.geo.location', |
| 292 | + metrics: [ |
| 293 | + { type: 'sum', field: 'client.bytes', label: 'client.bytes' }, |
| 294 | + { type: 'sum', field: 'server.bytes', label: 'server.bytes' }, |
| 295 | + ], |
| 296 | + }, |
| 297 | + style: { |
| 298 | + type: 'VECTOR', |
| 299 | + properties: { |
| 300 | + fillColor: { |
| 301 | + type: 'STATIC', |
| 302 | + options: { color: '#1EA593' }, |
| 303 | + }, |
| 304 | + lineColor: { |
| 305 | + type: 'STATIC', |
| 306 | + options: { color: '#6092C0' }, |
| 307 | + }, |
| 308 | + lineWidth: { |
| 309 | + type: 'DYNAMIC', |
| 310 | + options: { |
| 311 | + field: { |
| 312 | + label: 'count', |
| 313 | + name: 'doc_count', |
| 314 | + origin: 'source', |
| 315 | + }, |
| 316 | + minSize: 1, |
| 317 | + maxSize: 8, |
| 318 | + fieldMetaOptions: { |
| 319 | + isEnabled: true, |
| 320 | + sigma: 3, |
| 321 | + }, |
| 322 | + }, |
| 323 | + }, |
| 324 | + iconSize: { type: 'STATIC', options: { size: 10 } }, |
| 325 | + iconOrientation: { |
| 326 | + type: 'STATIC', |
| 327 | + options: { orientation: 0 }, |
| 328 | + }, |
| 329 | + symbol: { |
| 330 | + options: { symbolizeAs: 'circle', symbolId: 'airfield' }, |
| 331 | + }, |
| 332 | + }, |
| 333 | + }, |
| 334 | + id: 'uuid.v4()', |
| 335 | + label: `apm-* | Line`, |
| 336 | + minZoom: 0, |
| 337 | + maxZoom: 24, |
| 338 | + alpha: 0.5, |
| 339 | + visible: true, |
| 340 | + type: 'VECTOR', |
| 341 | + query: { query: '', language: 'kuery' }, |
| 342 | +}; |
| 343 | + |
176 | 344 | export const mockLayerList = [ |
177 | 345 | { |
178 | 346 | sourceDescriptor: { type: 'EMS_TMS', isAutoSelect: true }, |
@@ -209,3 +377,83 @@ export const mockLayerListDouble = [ |
209 | 377 | mockDestinationLayer, |
210 | 378 | mockSourceLayer, |
211 | 379 | ]; |
| 380 | + |
| 381 | +export const mockLayerListMixed = [ |
| 382 | + { |
| 383 | + sourceDescriptor: { type: 'EMS_TMS', isAutoSelect: true }, |
| 384 | + id: 'uuid.v4()', |
| 385 | + label: null, |
| 386 | + minZoom: 0, |
| 387 | + maxZoom: 24, |
| 388 | + alpha: 1, |
| 389 | + visible: true, |
| 390 | + style: null, |
| 391 | + type: 'VECTOR_TILE', |
| 392 | + }, |
| 393 | + mockLineLayer, |
| 394 | + mockDestinationLayer, |
| 395 | + mockSourceLayer, |
| 396 | + mockClientServerLineLayer, |
| 397 | + mockServerLayer, |
| 398 | + mockClientLayer, |
| 399 | +]; |
| 400 | + |
| 401 | +export const mockAPMIndexPattern: IndexPatternSavedObject = { |
| 402 | + id: 'apm-*', |
| 403 | + type: 'index-pattern', |
| 404 | + updated_at: '', |
| 405 | + version: 'abc', |
| 406 | + attributes: { |
| 407 | + title: 'apm-*', |
| 408 | + }, |
| 409 | +}; |
| 410 | + |
| 411 | +export const mockAPMRegexIndexPattern: IndexPatternSavedObject = { |
| 412 | + id: 'apm-7.*', |
| 413 | + type: 'index-pattern', |
| 414 | + updated_at: '', |
| 415 | + version: 'abc', |
| 416 | + attributes: { |
| 417 | + title: 'apm-7.*', |
| 418 | + }, |
| 419 | +}; |
| 420 | + |
| 421 | +export const mockFilebeatIndexPattern: IndexPatternSavedObject = { |
| 422 | + id: 'filebeat-*', |
| 423 | + type: 'index-pattern', |
| 424 | + updated_at: '', |
| 425 | + version: 'abc', |
| 426 | + attributes: { |
| 427 | + title: 'filebeat-*', |
| 428 | + }, |
| 429 | +}; |
| 430 | + |
| 431 | +export const mockAuditbeatIndexPattern: IndexPatternSavedObject = { |
| 432 | + id: 'auditbeat-*', |
| 433 | + type: 'index-pattern', |
| 434 | + updated_at: '', |
| 435 | + version: 'abc', |
| 436 | + attributes: { |
| 437 | + title: 'auditbeat-*', |
| 438 | + }, |
| 439 | +}; |
| 440 | + |
| 441 | +export const mockAPMTransactionIndexPattern: IndexPatternSavedObject = { |
| 442 | + id: 'apm-*-transaction*', |
| 443 | + type: 'index-pattern', |
| 444 | + updated_at: '', |
| 445 | + version: 'abc', |
| 446 | + attributes: { |
| 447 | + title: 'apm-*-transaction*', |
| 448 | + }, |
| 449 | +}; |
| 450 | + |
| 451 | +export const mockGlobIndexPattern: IndexPatternSavedObject = { |
| 452 | + id: '*', |
| 453 | + type: 'index-pattern', |
| 454 | + updated_at: '', |
| 455 | + version: 'abc', |
| 456 | + attributes: { |
| 457 | + title: '*', |
| 458 | + }, |
| 459 | +}; |
0 commit comments