MCPcopy Create free account
hub / github.com/rilldata/rill / newExplore

Function newExplore

runtime/controller_test.go:1383–1424  ·  view source on GitHub ↗
(metricsVew string, measures, dims []string)

Source from the content-addressed store, hash-verified

1381}
1382
1383func newExplore(metricsVew string, measures, dims []string) (*runtimev1.Explore, *runtimev1.Resource) {
1384 explore := &runtimev1.Explore{
1385 Spec: &runtimev1.ExploreSpec{
1386 DisplayName: parser.ToDisplayName(metricsVew),
1387 MetricsView: metricsVew,
1388 DimensionsSelector: &runtimev1.FieldSelector{Selector: &runtimev1.FieldSelector_All{All: true}},
1389 MeasuresSelector: &runtimev1.FieldSelector{Selector: &runtimev1.FieldSelector_All{All: true}},
1390 DefaultPreset: &runtimev1.ExplorePreset{
1391 DimensionsSelector: &runtimev1.FieldSelector{Selector: &runtimev1.FieldSelector_All{All: true}},
1392 MeasuresSelector: &runtimev1.FieldSelector{Selector: &runtimev1.FieldSelector_All{All: true}},
1393 },
1394 AllowCustomTimeRange: true,
1395 DefinedInMetricsView: true,
1396 },
1397 State: &runtimev1.ExploreState{
1398 ValidSpec: &runtimev1.ExploreSpec{
1399 DisplayName: parser.ToDisplayName(metricsVew),
1400 MetricsView: metricsVew,
1401 Dimensions: dims,
1402 Measures: measures,
1403 DefaultPreset: &runtimev1.ExplorePreset{
1404 Dimensions: dims,
1405 Measures: measures,
1406 },
1407 AllowCustomTimeRange: true,
1408 DefinedInMetricsView: true,
1409 },
1410 },
1411 }
1412 exploreRes := &runtimev1.Resource{
1413 Meta: &runtimev1.ResourceMeta{
1414 Name: &runtimev1.ResourceName{Kind: runtime.ResourceKindExplore, Name: metricsVew},
1415 Refs: []*runtimev1.ResourceName{{Kind: runtime.ResourceKindMetricsView, Name: metricsVew}},
1416 Owner: runtime.GlobalProjectParserName,
1417 FilePaths: []string{fmt.Sprintf("/metrics/%s.yaml", metricsVew)},
1418 },
1419 Resource: &runtimev1.Resource_Explore{
1420 Explore: explore,
1421 },
1422 }
1423 return explore, exploreRes
1424}
1425
1426func TestDedicatedConnector(t *testing.T) {
1427 // Acquire the connectors for the runtime instance.

Callers 1

TestDerivedMetricsViewFunction · 0.85

Calls 1

ToDisplayNameFunction · 0.92

Tested by

no test coverage detected