Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added two env vars for enabling query performance #4917

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/packages/core/src/components/Actions/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ const Lightning = () => {
<>
<ActionOption
id="lightning-mode"
text="Lightning mode"
text="Query Performance mode"
href={LIGHTNING_MODE}
title={"More on lightning mode"}
title={"More on Query Performance mode"}
style={{
background: "unset",
color: theme.text.primary,
Expand Down
2 changes: 2 additions & 0 deletions app/packages/relay/src/fragments/configFragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default r(graphql`
disableFrameFiltering
gridZoom
lightningThreshold
enableQueryPerformance
defaultQueryPerformance
loopVideos
mediaFallback
multicolorKeypoints
Expand Down
162 changes: 26 additions & 136 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ input Aggregate {
histogramValues: HistogramValues = null
}

union AggregateResult =
BooleanAggregation
| DataAggregation
| IntAggregation
| FloatAggregation
| RootAggregation
| StringAggregation
union AggregateResult = BooleanAggregation | DataAggregation | IntAggregation | FloatAggregation | RootAggregation | StringAggregation

interface Aggregation {
path: String!
Expand All @@ -34,14 +28,7 @@ input AggregationForm {
viewName: String = null
}

union AggregationResponses =
CountResponse
| BoolCountValuesResponse
| IntCountValuesResponse
| StrCountValuesResponse
| DatetimeHistogramValuesResponse
| FloatHistogramValuesResponse
| IntHistogramValuesResponse
union AggregationResponses = CountResponse | BoolCountValuesResponse | IntCountValuesResponse | StrCountValuesResponse | DatetimeHistogramValuesResponse | FloatHistogramValuesResponse | IntHistogramValuesResponse

type AppConfig {
colorBy: ColorBy!
Expand All @@ -63,7 +50,6 @@ type AppConfig {
timezone: String
useFrameNumber: Boolean!
spaces: JSON
disableFrameFiltering: Boolean!
mediaFallback: Boolean!
}

Expand Down Expand Up @@ -240,21 +226,22 @@ type Dataset {
estimatedSampleCount: Int!
frameIndexes: [Index!]
sampleIndexes: [Index!]
headName: String
snapshotName: String
stages(slug: String = null, view: BSONArray = null): BSONArray
workspace(slug: String): Workspace
}

type DatasetAppConfig {
colorScheme: ColorScheme
disableFrameFiltering: Boolean
gridMediaField: String!
mediaFields: [String!]
modalMediaField: String!
mediaFallback: Boolean!
plugins: JSON
sidebarGroups: [SidebarGroup!]
sidebarMode: SidebarMode
spaces: JSON
gridMediaField: String!
modalMediaField: String!
mediaFallback: Boolean!
}

type DatasetStrConnection {
Expand Down Expand Up @@ -445,9 +432,7 @@ input LightningInput {
input LightningPathInput {
path: String!

"""
exclude these values from results
"""
"""exclude these values from results"""
exclude: [String!] = null
first: Int = 200
search: String = null
Expand All @@ -457,13 +442,7 @@ interface LightningResult {
path: String!
}

union LightningResults =
BooleanLightningResult
| DateLightningResult
| DateTimeLightningResult
| FloatLightningResult
| IntLightningResult
| StringLightningResult
union LightningResults = BooleanLightningResult | DateLightningResult | DateTimeLightningResult | FloatLightningResult | IntLightningResult | StringLightningResult

type MaskColor {
color: String!
Expand All @@ -489,81 +468,19 @@ type MediaURL {
}

type Mutation {
setColorScheme(
subscription: String!
colorScheme: ColorSchemeInput!
): ColorScheme!
setDatasetColorScheme(
subscription: String!
datasetName: String!
colorScheme: ColorSchemeInput = null
): ColorScheme
setFieldVisibilityStage(
subscription: String!
session: String
stage: BSON
): Boolean!
setDataset(
subscription: String!
session: String
name: String
viewName: String
): Boolean!
setColorScheme(subscription: String!, colorScheme: ColorSchemeInput!): ColorScheme!
setDatasetColorScheme(subscription: String!, datasetName: String!, colorScheme: ColorSchemeInput = null): ColorScheme
setFieldVisibilityStage(subscription: String!, session: String, stage: BSON): Boolean!
setDataset(subscription: String!, session: String, name: String, viewName: String): Boolean!
setGroupSlice(subscription: String!, session: String, slice: String): Boolean!
setSample(
subscription: String!
session: String
groupId: String
id: String
): Boolean!
setSidebarGroups(
subscription: String!
session: String
dataset: String!
stages: BSONArray!
sidebarGroups: [SidebarGroupInput!]!
): Boolean!
setSelected(
subscription: String!
session: String
selected: [String!]!
): Boolean!
setSelectedLabels(
subscription: String!
session: String
selectedLabels: [SelectedLabel!]!
): Boolean!
setView(
subscription: String!
session: String
datasetName: String!
view: BSONArray = null
savedViewSlug: String = null
form: StateForm = null
): BSONArray
createSavedView(
subscription: String!
session: String
viewName: String!
viewStages: BSONArray = null
form: StateForm = null
datasetName: String = null
description: String = null
color: String = null
): SavedView
deleteSavedView(
subscription: String!
session: String
viewName: String!
datasetName: String
): String
updateSavedView(
viewName: String!
subscription: String
session: String
updatedInfo: SavedViewInfo!
datasetName: String = null
): SavedView
setSample(subscription: String!, session: String, groupId: String, id: String): Boolean!
setSidebarGroups(subscription: String!, session: String, dataset: String!, stages: BSONArray!, sidebarGroups: [SidebarGroupInput!]!): Boolean!
setSelected(subscription: String!, session: String, selected: [String!]!): Boolean!
setSelectedLabels(subscription: String!, session: String, selectedLabels: [SelectedLabel!]!): Boolean!
setView(subscription: String!, session: String, datasetName: String!, view: BSONArray = null, savedViewSlug: String = null, form: StateForm = null): BSONArray
createSavedView(subscription: String!, session: String, viewName: String!, viewStages: BSONArray = null, form: StateForm = null, datasetName: String = null, description: String = null, color: String = null): SavedView
deleteSavedView(subscription: String!, session: String, viewName: String!, datasetName: String): String
updateSavedView(viewName: String!, subscription: String, session: String, updatedInfo: SavedViewInfo!, datasetName: String = null): SavedView
setSpaces(subscription: String!, session: String, spaces: BSON!): Boolean!
searchSelectFields(datasetName: String!, metaFilter: JSON): [String!]!
}
Expand All @@ -587,19 +504,9 @@ type PointCloudSample implements Sample {
}

type Query {
aggregate(
datasetName: String!
view: BSONArray
aggregations: [Aggregate!]!
viewName: String = null
form: ExtendedViewForm = null
): [AggregationResponses!]!
aggregate(datasetName: String!, view: BSONArray, aggregations: [Aggregate!]!, viewName: String = null, form: ExtendedViewForm = null): [AggregationResponses!]!
dataset(name: String!, savedViewSlug: String, view: BSONArray = null): Dataset
datasets(
search: String
first: Int = 200
after: String = null
): DatasetStrConnection!
datasets(search: String, first: Int = 200, after: String = null): DatasetStrConnection!
aggregations(form: AggregationForm!): [AggregateResult!]!
lightning(input: LightningInput!): [LightningResults!]!
colorscale: [[Int!]!]
Expand All @@ -608,30 +515,13 @@ type Query {
dev: Boolean!
doNotTrack: Boolean!
estimatedDatasetCount: Int!
samples(
dataset: String!
view: BSONArray!
first: Int = 20
after: String = null
filter: SampleFilter = null
filters: BSON = null
extendedStages: BSON = null
paginationData: Boolean = true
): SampleItemStrConnection!
sample(
dataset: String!
view: BSONArray!
filter: SampleFilter!
filters: JSON = null
): SampleItem
samples(dataset: String!, view: BSONArray!, first: Int = 20, after: String = null, filter: SampleFilter = null, filters: BSON = null, extendedStages: BSON = null, paginationData: Boolean = true): SampleItemStrConnection!
sample(dataset: String!, view: BSONArray!, filter: SampleFilter!, filters: JSON = null): SampleItem
stageDefinitions: [StageDefinition!]!
uid: String!
version: String!
savedViews(datasetName: String!): [SavedView!]
schemaForViewStages(
datasetName: String!
viewStages: BSONArray!
): SchemaResult!
schemaForViewStages(datasetName: String!, viewStages: BSONArray!): SchemaResult!
}

type RootAggregation implements Aggregation {
Expand Down
9 changes: 9 additions & 0 deletions fiftyone/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,21 @@ def __init__(self, d=None):
self.grid_zoom = self.parse_int(
d, "grid_zoom", env_var="FIFTYONE_APP_GRID_ZOOM", default=5
)
# deprecate lightning threshold in favor of a timer-based approach
self.lightning_threshold = self.parse_int(
d,
"lightning_threshold",
env_var="FIFTYONE_APP_LIGHTNING_THRESHOLD",
default=None,
)
self.enable_query_performance = self.parse_bool(
d, "enable_query_performance",
env_var="FIFTYONE_APP_ENABLE_QUERY_PERFORMANCE", default=True
)
self.default_query_performance = self.parse_bool(
d, "default_query_performance",
env_var="FIFTYONE_APP_DEFAULT_QUERY_PERFORMANCE", default=True
)
self.loop_videos = self.parse_bool(
d,
"loop_videos",
Expand Down
2 changes: 2 additions & 0 deletions fiftyone/server/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ class AppConfig:
colorscale: str
grid_zoom: int
lightning_threshold: t.Optional[int]
enable_query_performance: bool
default_query_performance: bool
loop_videos: bool
multicolor_keypoints: bool
notebook_height: int
Expand Down
Loading