2021-10-19 03:36:41 +03:00
|
|
|
import re
|
2021-06-22 21:48:09 +03:00
|
|
|
from textwrap import dedent
|
|
|
|
|
|
|
|
import lkml
|
2021-10-19 03:36:41 +03:00
|
|
|
import pandas as pd
|
2021-06-22 21:48:09 +03:00
|
|
|
import pytest
|
|
|
|
from google.cloud import bigquery
|
|
|
|
from google.cloud.bigquery.schema import SchemaField
|
|
|
|
|
2021-10-19 03:36:41 +03:00
|
|
|
from generator.dashboards import OperationalMonitoringDashboard
|
2021-06-22 21:48:09 +03:00
|
|
|
from generator.explores import OperationalMonitoringExplore
|
2022-07-07 20:53:41 +03:00
|
|
|
from generator.views import OperationalMonitoringView
|
2021-06-22 21:48:09 +03:00
|
|
|
|
|
|
|
from .utils import print_and_test
|
|
|
|
|
|
|
|
|
|
|
|
class MockClient:
|
|
|
|
"""Mock bigquery.Client."""
|
|
|
|
|
2021-10-19 03:36:41 +03:00
|
|
|
def query(self, query):
|
|
|
|
class QueryJob:
|
|
|
|
def result(self):
|
|
|
|
class ResultObject:
|
|
|
|
def to_dataframe(self):
|
2022-09-20 20:23:19 +03:00
|
|
|
if "summaries" in query:
|
2021-10-19 03:36:41 +03:00
|
|
|
return pd.DataFrame(
|
2022-09-20 20:23:19 +03:00
|
|
|
[
|
|
|
|
{"metric": "GC_MS", "statistic": "mean"},
|
|
|
|
{
|
|
|
|
"metric": "GC_MS_CONTENT",
|
|
|
|
"statistic": "percentile",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
columns=["summary"],
|
2021-10-19 03:36:41 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
pattern = re.compile("SELECT DISTINCT (.*), COUNT")
|
|
|
|
column = pattern.findall(query)[0]
|
|
|
|
data = [["Windows", 10]]
|
|
|
|
if column == "cores_count":
|
|
|
|
data = [["4", 100]]
|
|
|
|
|
|
|
|
return pd.DataFrame(data, columns=[column, "count"])
|
|
|
|
|
|
|
|
return ResultObject()
|
|
|
|
|
|
|
|
return QueryJob()
|
|
|
|
|
2021-06-22 21:48:09 +03:00
|
|
|
def get_table(self, table_ref):
|
|
|
|
"""Mock bigquery.Client.get_table."""
|
2022-09-20 20:23:19 +03:00
|
|
|
return bigquery.Table(
|
|
|
|
table_ref,
|
|
|
|
schema=[
|
|
|
|
SchemaField("client_id", "STRING"),
|
|
|
|
SchemaField("build_id", "STRING"),
|
|
|
|
SchemaField("cores_count", "STRING"),
|
|
|
|
SchemaField("os", "STRING"),
|
|
|
|
SchemaField("branch", "STRING"),
|
|
|
|
SchemaField("metric", "STRING"),
|
|
|
|
SchemaField("statistic", "STRING"),
|
|
|
|
SchemaField("point", "FLOAT"),
|
|
|
|
SchemaField("lower", "FLOAT"),
|
|
|
|
SchemaField("upper", "FLOAT"),
|
|
|
|
SchemaField("parameter", "FLOAT"),
|
|
|
|
],
|
|
|
|
)
|
2021-06-22 21:48:09 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
2022-07-07 20:53:41 +03:00
|
|
|
def operational_monitoring_view():
|
|
|
|
return OperationalMonitoringView(
|
2021-06-22 21:48:09 +03:00
|
|
|
"operational_monitoring",
|
2022-07-07 20:53:41 +03:00
|
|
|
"fission",
|
2022-03-25 21:40:45 +03:00
|
|
|
[
|
|
|
|
{
|
2022-09-20 20:23:19 +03:00
|
|
|
"table": "moz-fx-data-shared-prod.operational_monitoring.bug_123_test_statistics",
|
2022-07-07 20:53:41 +03:00
|
|
|
"xaxis": "build_id",
|
2022-03-25 21:40:45 +03:00
|
|
|
"dimensions": {
|
|
|
|
"cores_count": {
|
|
|
|
"default": "4",
|
|
|
|
"options": ["4", "1"],
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"default": "Windows",
|
|
|
|
"options": ["Windows", "Linux"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
2021-06-22 21:48:09 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
2022-07-07 20:53:41 +03:00
|
|
|
def operational_monitoring_explore(tmp_path, operational_monitoring_view):
|
|
|
|
(tmp_path / "fission.view.lkml").write_text(
|
|
|
|
lkml.dump(operational_monitoring_view.to_lookml(MockClient(), None))
|
2021-06-22 21:48:09 +03:00
|
|
|
)
|
|
|
|
return OperationalMonitoringExplore(
|
2022-07-07 20:53:41 +03:00
|
|
|
"fission",
|
|
|
|
{"base_view": "fission"},
|
2021-06-22 21:48:09 +03:00
|
|
|
tmp_path,
|
2022-03-25 21:40:45 +03:00
|
|
|
{
|
|
|
|
"branches": ["enabled", "disabled"],
|
|
|
|
"dimensions": {
|
|
|
|
"cores_count": {
|
|
|
|
"default": "4",
|
|
|
|
"options": ["4", "1"],
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"default": "Windows",
|
|
|
|
"options": ["Windows", "Linux"],
|
|
|
|
},
|
|
|
|
},
|
2022-09-20 20:23:19 +03:00
|
|
|
"summaries": [
|
|
|
|
{"metric": "GC_MS", "statistic": "mean"},
|
|
|
|
{"metric": "GC_MS_CONTENT", "statistic": "percentile"},
|
|
|
|
],
|
2022-03-25 21:40:45 +03:00
|
|
|
"xaxis": "build_id",
|
|
|
|
},
|
2021-06-22 21:48:09 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-10-19 03:36:41 +03:00
|
|
|
@pytest.fixture()
|
|
|
|
def operational_monitoring_dashboard():
|
|
|
|
return OperationalMonitoringDashboard(
|
|
|
|
"Fission",
|
|
|
|
"fission",
|
|
|
|
"newspaper",
|
|
|
|
"operational_monitoring",
|
2021-12-08 19:01:52 +03:00
|
|
|
[
|
|
|
|
{
|
2022-09-20 20:23:19 +03:00
|
|
|
"table": "moz-fx-data-shared-prod.operational_monitoring.bug_123_test_statistics",
|
2022-07-07 20:53:41 +03:00
|
|
|
"explore": "fission",
|
2021-12-08 19:01:52 +03:00
|
|
|
"branches": ["enabled", "disabled"],
|
2022-03-25 21:40:45 +03:00
|
|
|
"dimensions": {
|
|
|
|
"cores_count": {
|
|
|
|
"default": "4",
|
|
|
|
"options": ["4", "1"],
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"default": "Windows",
|
|
|
|
"options": ["Windows", "Linux"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"xaxis": "build_id",
|
2022-09-20 20:23:19 +03:00
|
|
|
"summaries": [
|
|
|
|
{"metric": "GC_MS", "statistic": "mean"},
|
|
|
|
{"metric": "GC_MS_CONTENT", "statistic": "percentile"},
|
|
|
|
],
|
2022-03-25 21:40:45 +03:00
|
|
|
},
|
2021-12-08 19:01:52 +03:00
|
|
|
],
|
2021-10-19 03:36:41 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-07-07 20:53:41 +03:00
|
|
|
def test_view_from_dict(operational_monitoring_view):
|
|
|
|
actual = OperationalMonitoringView.from_dict(
|
2021-06-22 21:48:09 +03:00
|
|
|
"operational_monitoring",
|
2022-07-07 20:53:41 +03:00
|
|
|
"fission",
|
2021-06-22 21:48:09 +03:00
|
|
|
{
|
2022-07-07 20:53:41 +03:00
|
|
|
"type": "operational_monitoring_view",
|
2022-03-25 21:40:45 +03:00
|
|
|
"tables": [
|
|
|
|
{
|
2022-09-20 20:23:19 +03:00
|
|
|
"table": "moz-fx-data-shared-prod.operational_monitoring.bug_123_test_statistics",
|
2022-03-25 21:40:45 +03:00
|
|
|
"xaxis": "build_id",
|
|
|
|
"dimensions": {
|
|
|
|
"cores_count": {
|
|
|
|
"default": "4",
|
|
|
|
"options": ["4", "1"],
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"default": "Windows",
|
|
|
|
"options": ["Windows", "Linux"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
2021-06-22 21:48:09 +03:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2022-07-07 20:53:41 +03:00
|
|
|
assert actual == operational_monitoring_view
|
2021-06-22 21:48:09 +03:00
|
|
|
|
|
|
|
|
2022-07-07 20:53:41 +03:00
|
|
|
def test_view_lookml(operational_monitoring_view):
|
2021-06-22 21:48:09 +03:00
|
|
|
mock_bq_client = MockClient()
|
|
|
|
expected = {
|
|
|
|
"views": [
|
|
|
|
{
|
|
|
|
"dimensions": [
|
|
|
|
{
|
|
|
|
"name": "build_id",
|
2022-09-20 20:23:19 +03:00
|
|
|
"sql": "PARSE_DATE('%Y%m%d', "
|
|
|
|
"CAST(${TABLE}.build_id AS STRING))",
|
2021-06-22 21:48:09 +03:00
|
|
|
"type": "date",
|
2022-10-12 19:03:00 +03:00
|
|
|
"datatype": "date",
|
|
|
|
"convert_tz": "no",
|
2021-06-22 21:48:09 +03:00
|
|
|
},
|
|
|
|
{"name": "branch", "sql": "${TABLE}.branch", "type": "string"},
|
|
|
|
{
|
|
|
|
"name": "cores_count",
|
|
|
|
"sql": "${TABLE}.cores_count",
|
|
|
|
"type": "string",
|
|
|
|
},
|
2022-09-20 20:23:19 +03:00
|
|
|
{"name": "metric", "sql": "${TABLE}.metric", "type": "string"},
|
2021-06-22 21:48:09 +03:00
|
|
|
{"name": "os", "sql": "${TABLE}.os", "type": "string"},
|
2022-09-20 20:23:19 +03:00
|
|
|
{
|
|
|
|
"name": "parameter",
|
|
|
|
"sql": "${TABLE}.parameter",
|
|
|
|
"type": "number",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "statistic",
|
|
|
|
"sql": "${TABLE}.statistic",
|
|
|
|
"type": "string",
|
|
|
|
},
|
2021-06-22 21:48:09 +03:00
|
|
|
],
|
2022-09-20 20:23:19 +03:00
|
|
|
"name": "fission",
|
|
|
|
"sql_table_name": "moz-fx-data-shared-prod.operational_monitoring.bug_123_test_statistics",
|
2022-09-21 19:49:28 +03:00
|
|
|
"measures": [
|
|
|
|
{"name": "point", "sql": "${TABLE}.point", "type": "sum"},
|
|
|
|
{"name": "upper", "sql": "${TABLE}.upper", "type": "sum"},
|
|
|
|
{"name": "lower", "sql": "${TABLE}.lower", "type": "sum"},
|
|
|
|
],
|
2021-06-22 21:48:09 +03:00
|
|
|
}
|
2022-09-20 20:23:19 +03:00
|
|
|
]
|
2021-06-22 21:48:09 +03:00
|
|
|
}
|
2022-07-07 20:53:41 +03:00
|
|
|
actual = operational_monitoring_view.to_lookml(mock_bq_client, None)
|
|
|
|
print(actual)
|
2021-06-22 21:48:09 +03:00
|
|
|
|
|
|
|
print_and_test(expected=expected, actual=actual)
|
|
|
|
|
|
|
|
|
|
|
|
def test_explore_lookml(operational_monitoring_explore):
|
2021-11-09 18:47:34 +03:00
|
|
|
mock_bq_client = MockClient()
|
2021-06-22 21:48:09 +03:00
|
|
|
expected = [
|
|
|
|
{
|
2021-11-09 18:47:34 +03:00
|
|
|
"always_filter": {"filters": [{"branch": "enabled, disabled"}]},
|
2022-07-07 20:53:41 +03:00
|
|
|
"name": "fission",
|
|
|
|
"hidden": "yes",
|
2021-11-09 18:47:34 +03:00
|
|
|
}
|
2021-06-22 21:48:09 +03:00
|
|
|
]
|
|
|
|
|
2022-03-25 21:40:45 +03:00
|
|
|
actual = operational_monitoring_explore.to_lookml(mock_bq_client, None)
|
2021-06-22 21:48:09 +03:00
|
|
|
print_and_test(expected=expected, actual=actual)
|
2021-10-19 03:36:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
def test_dashboard_lookml(operational_monitoring_dashboard):
|
|
|
|
mock_bq_client = MockClient()
|
|
|
|
expected = dedent(
|
|
|
|
"""\
|
2022-07-07 20:53:41 +03:00
|
|
|
- dashboard: fission
|
|
|
|
title: Fission
|
|
|
|
layout: newspaper
|
|
|
|
preferred_viewer: dashboards-next
|
|
|
|
|
|
|
|
elements:
|
|
|
|
- title: Gc Ms
|
2022-09-20 20:23:19 +03:00
|
|
|
name: Gc Ms_mean
|
|
|
|
note_state: expanded
|
|
|
|
note_display: above
|
|
|
|
note_text: Mean
|
2022-07-07 20:53:41 +03:00
|
|
|
explore: fission
|
2022-09-20 20:23:19 +03:00
|
|
|
type: looker_line
|
2022-07-07 20:53:41 +03:00
|
|
|
fields: [
|
|
|
|
fission.build_id,
|
|
|
|
fission.branch,
|
2022-09-20 20:23:19 +03:00
|
|
|
fission.point
|
2022-07-07 20:53:41 +03:00
|
|
|
]
|
|
|
|
pivots: [
|
|
|
|
fission.branch
|
|
|
|
]
|
|
|
|
filters:
|
2022-10-31 23:03:39 +03:00
|
|
|
fission.metric: 'GC_MS'
|
2022-09-20 20:23:19 +03:00
|
|
|
fission.statistic: mean
|
2022-07-07 20:53:41 +03:00
|
|
|
row: 0
|
|
|
|
col: 0
|
|
|
|
width: 12
|
|
|
|
height: 8
|
|
|
|
field_x: fission.build_id
|
2022-09-20 20:23:19 +03:00
|
|
|
field_y: fission.point
|
2022-07-07 20:53:41 +03:00
|
|
|
log_scale: false
|
2022-09-20 20:23:19 +03:00
|
|
|
ci_lower: fission.lower
|
|
|
|
ci_upper: fission.upper
|
2022-07-07 20:53:41 +03:00
|
|
|
show_grid: true
|
|
|
|
listen:
|
2022-10-12 19:03:00 +03:00
|
|
|
Date: fission.build_id
|
2022-07-07 20:53:41 +03:00
|
|
|
Cores Count: fission.cores_count
|
|
|
|
Os: fission.os
|
|
|
|
|
|
|
|
enabled: "#3FE1B0"
|
|
|
|
disabled: "#0060E0"
|
|
|
|
defaults_version: 0
|
|
|
|
- title: Gc Ms Content
|
2022-09-20 20:23:19 +03:00
|
|
|
name: Gc Ms Content_percentile
|
|
|
|
note_state: expanded
|
|
|
|
note_display: above
|
|
|
|
note_text: Percentile
|
2022-07-07 20:53:41 +03:00
|
|
|
explore: fission
|
|
|
|
type: "ci-line-chart"
|
|
|
|
fields: [
|
|
|
|
fission.build_id,
|
|
|
|
fission.branch,
|
2022-09-20 20:23:19 +03:00
|
|
|
fission.upper,
|
|
|
|
fission.lower,
|
|
|
|
fission.point
|
2022-07-07 20:53:41 +03:00
|
|
|
]
|
|
|
|
pivots: [
|
|
|
|
fission.branch
|
|
|
|
]
|
|
|
|
filters:
|
2022-10-31 23:03:39 +03:00
|
|
|
fission.metric: 'GC_MS_CONTENT'
|
2022-09-20 20:23:19 +03:00
|
|
|
fission.statistic: percentile
|
2022-07-07 20:53:41 +03:00
|
|
|
row: 0
|
|
|
|
col: 12
|
|
|
|
width: 12
|
|
|
|
height: 8
|
|
|
|
field_x: fission.build_id
|
2022-09-20 20:23:19 +03:00
|
|
|
field_y: fission.point
|
2022-07-07 20:53:41 +03:00
|
|
|
log_scale: false
|
2022-09-20 20:23:19 +03:00
|
|
|
ci_lower: fission.lower
|
|
|
|
ci_upper: fission.upper
|
2022-07-07 20:53:41 +03:00
|
|
|
show_grid: true
|
|
|
|
listen:
|
2022-10-12 19:03:00 +03:00
|
|
|
Date: fission.build_id
|
2022-09-20 20:23:19 +03:00
|
|
|
Percentile: fission.parameter
|
2022-07-07 20:53:41 +03:00
|
|
|
Cores Count: fission.cores_count
|
|
|
|
Os: fission.os
|
|
|
|
|
|
|
|
enabled: "#3FE1B0"
|
|
|
|
disabled: "#0060E0"
|
|
|
|
defaults_version: 0
|
|
|
|
|
|
|
|
filters:
|
2022-10-12 19:03:00 +03:00
|
|
|
- name: Date
|
|
|
|
title: Date
|
|
|
|
type: field_filter
|
|
|
|
allow_multiple_values: true
|
|
|
|
required: false
|
|
|
|
ui_config:
|
|
|
|
type: advanced
|
|
|
|
display: popover
|
|
|
|
model: operational_monitoring
|
|
|
|
explore: fission
|
|
|
|
listens_to_filters: []
|
|
|
|
field: fission.build_id
|
|
|
|
|
2022-07-07 20:53:41 +03:00
|
|
|
- name: Percentile
|
|
|
|
title: Percentile
|
2022-09-20 20:23:19 +03:00
|
|
|
type: field_filter
|
2022-07-07 20:53:41 +03:00
|
|
|
default_value: '50'
|
|
|
|
allow_multiple_values: false
|
|
|
|
required: true
|
|
|
|
ui_config:
|
2022-09-21 23:51:08 +03:00
|
|
|
type: advanced
|
|
|
|
display: popover
|
2022-09-20 20:23:19 +03:00
|
|
|
model: operational_monitoring
|
|
|
|
explore: fission
|
|
|
|
listens_to_filters: []
|
|
|
|
field: fission.parameter
|
2022-07-07 20:53:41 +03:00
|
|
|
|
|
|
|
- title: Cores Count
|
|
|
|
name: Cores Count
|
|
|
|
type: string_filter
|
|
|
|
default_value: '4'
|
|
|
|
allow_multiple_values: false
|
|
|
|
required: true
|
|
|
|
ui_config:
|
|
|
|
type: dropdown_menu
|
|
|
|
display: inline
|
|
|
|
options:
|
|
|
|
- '4'
|
|
|
|
- '1'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- title: Os
|
|
|
|
name: Os
|
|
|
|
type: string_filter
|
|
|
|
default_value: 'Windows'
|
|
|
|
allow_multiple_values: false
|
|
|
|
required: true
|
|
|
|
ui_config:
|
|
|
|
type: dropdown_menu
|
|
|
|
display: inline
|
|
|
|
options:
|
|
|
|
- 'Windows'
|
|
|
|
- 'Linux'
|
2021-10-19 03:36:41 +03:00
|
|
|
|
2022-04-13 23:49:52 +03:00
|
|
|
|
2021-10-19 03:36:41 +03:00
|
|
|
"""
|
|
|
|
)
|
2022-03-25 21:40:45 +03:00
|
|
|
actual = operational_monitoring_dashboard.to_lookml(mock_bq_client)
|
2021-10-19 03:36:41 +03:00
|
|
|
|
|
|
|
print_and_test(expected=expected, actual=dedent(actual))
|
2023-12-04 20:59:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def operational_monitoring_dashboard_group_by_dimension():
|
|
|
|
return OperationalMonitoringDashboard(
|
|
|
|
"Fission",
|
|
|
|
"fission",
|
|
|
|
"newspaper",
|
|
|
|
"operational_monitoring",
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"table": "moz-fx-data-shared-prod.operational_monitoring.bug_123_test_statistics",
|
|
|
|
"explore": "fission",
|
|
|
|
"branches": ["enabled", "disabled"],
|
|
|
|
"dimensions": {
|
|
|
|
"cores_count": {
|
|
|
|
"default": "4",
|
|
|
|
"options": ["4", "1"],
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"default": "Windows",
|
|
|
|
"options": ["Windows", "Linux"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"group_by_dimension": "os",
|
|
|
|
"xaxis": "build_id",
|
|
|
|
"summaries": [
|
|
|
|
{"metric": "GC_MS", "statistic": "mean"},
|
|
|
|
{"metric": "GC_MS_CONTENT", "statistic": "percentile"},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_dashboard_lookml_group_by_dimension(
|
|
|
|
operational_monitoring_dashboard_group_by_dimension,
|
|
|
|
):
|
|
|
|
mock_bq_client = MockClient()
|
|
|
|
expected = dedent(
|
|
|
|
"""\
|
|
|
|
- dashboard: fission
|
|
|
|
title: Fission
|
|
|
|
layout: newspaper
|
|
|
|
preferred_viewer: dashboards-next
|
|
|
|
|
|
|
|
elements:
|
|
|
|
- title: Gc Ms - By os
|
|
|
|
name: Gc Ms - By os_mean
|
|
|
|
note_state: expanded
|
|
|
|
note_display: above
|
|
|
|
note_text: Mean
|
|
|
|
explore: fission
|
|
|
|
type: looker_line
|
|
|
|
fields: [
|
|
|
|
fission.build_id,
|
|
|
|
fission.branch,
|
|
|
|
fission.point
|
|
|
|
]
|
|
|
|
pivots: [
|
|
|
|
fission.branch, fission.os
|
|
|
|
]
|
|
|
|
filters:
|
|
|
|
fission.metric: 'GC_MS'
|
|
|
|
fission.statistic: mean
|
|
|
|
row: 0
|
|
|
|
col: 0
|
|
|
|
width: 12
|
|
|
|
height: 8
|
|
|
|
field_x: fission.build_id
|
|
|
|
field_y: fission.point
|
|
|
|
log_scale: false
|
|
|
|
ci_lower: fission.lower
|
|
|
|
ci_upper: fission.upper
|
|
|
|
show_grid: true
|
|
|
|
listen:
|
|
|
|
Date: fission.build_id
|
|
|
|
Cores Count: fission.cores_count
|
|
|
|
Os: fission.os
|
|
|
|
|
|
|
|
enabled: "#3FE1B0"
|
|
|
|
disabled: "#0060E0"
|
|
|
|
defaults_version: 0
|
|
|
|
- title: Gc Ms Content - By os
|
|
|
|
name: Gc Ms Content - By os_percentile
|
|
|
|
note_state: expanded
|
|
|
|
note_display: above
|
|
|
|
note_text: Percentile
|
|
|
|
explore: fission
|
|
|
|
type: "ci-line-chart"
|
|
|
|
fields: [
|
|
|
|
fission.build_id,
|
|
|
|
fission.branch,
|
|
|
|
fission.upper,
|
|
|
|
fission.lower,
|
|
|
|
fission.point
|
|
|
|
]
|
|
|
|
pivots: [
|
|
|
|
fission.branch, fission.os
|
|
|
|
]
|
|
|
|
filters:
|
|
|
|
fission.metric: 'GC_MS_CONTENT'
|
|
|
|
fission.statistic: percentile
|
|
|
|
row: 0
|
|
|
|
col: 12
|
|
|
|
width: 12
|
|
|
|
height: 8
|
|
|
|
field_x: fission.build_id
|
|
|
|
field_y: fission.point
|
|
|
|
log_scale: false
|
|
|
|
ci_lower: fission.lower
|
|
|
|
ci_upper: fission.upper
|
|
|
|
show_grid: true
|
|
|
|
listen:
|
|
|
|
Date: fission.build_id
|
|
|
|
Percentile: fission.parameter
|
|
|
|
Cores Count: fission.cores_count
|
|
|
|
Os: fission.os
|
|
|
|
|
|
|
|
enabled: "#3FE1B0"
|
|
|
|
disabled: "#0060E0"
|
|
|
|
defaults_version: 0
|
|
|
|
|
|
|
|
filters:
|
|
|
|
- name: Date
|
|
|
|
title: Date
|
|
|
|
type: field_filter
|
|
|
|
allow_multiple_values: true
|
|
|
|
required: false
|
|
|
|
ui_config:
|
|
|
|
type: advanced
|
|
|
|
display: popover
|
|
|
|
model: operational_monitoring
|
|
|
|
explore: fission
|
|
|
|
listens_to_filters: []
|
|
|
|
field: fission.build_id
|
|
|
|
|
|
|
|
- name: Percentile
|
|
|
|
title: Percentile
|
|
|
|
type: field_filter
|
|
|
|
default_value: '50'
|
|
|
|
allow_multiple_values: false
|
|
|
|
required: true
|
|
|
|
ui_config:
|
|
|
|
type: advanced
|
|
|
|
display: popover
|
|
|
|
model: operational_monitoring
|
|
|
|
explore: fission
|
|
|
|
listens_to_filters: []
|
|
|
|
field: fission.parameter
|
|
|
|
|
|
|
|
- title: Cores Count
|
|
|
|
name: Cores Count
|
|
|
|
type: string_filter
|
|
|
|
default_value: '4'
|
|
|
|
allow_multiple_values: false
|
|
|
|
required: true
|
|
|
|
ui_config:
|
|
|
|
type: dropdown_menu
|
|
|
|
display: inline
|
|
|
|
options:
|
|
|
|
- '4'
|
|
|
|
- '1'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- title: Os
|
|
|
|
name: Os
|
|
|
|
type: string_filter
|
|
|
|
default_value: 'Linux,Windows'
|
|
|
|
allow_multiple_values: true
|
|
|
|
required: true
|
|
|
|
ui_config:
|
|
|
|
type: advanced
|
|
|
|
display: inline
|
|
|
|
options:
|
|
|
|
- 'Linux'
|
|
|
|
- 'Windows'
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
)
|
|
|
|
actual = operational_monitoring_dashboard_group_by_dimension.to_lookml(
|
|
|
|
mock_bq_client
|
|
|
|
)
|
|
|
|
|
|
|
|
print_and_test(expected=expected, actual=dedent(actual))
|