Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Architecture Frontend

Alexander Dubrawski edited this page Oct 5, 2020 · 14 revisions

Main Idea

The frontend uses Vue (https://vuejs.org/) as a javascript framework. In the code you will wind four types of main components:

  • vue-components: These are vue files and are describing the components you are seeing in the graphical user interface when running the cockpit.
  • Controller: These components are saving the state. For example which databases are selected.
  • Services: These components are interacting directly with the backend.
  • Mata: Are helper components that are providing helper functions.

The frontend is using the self-defined controllers instead of a state management library like for example Vuex. Moreover the frontend is using a separate Vue Instance as an event bus. The components can listen or trigger an Event on this Bus.

Architecture

Basic libraries

Before having a look in the code you should have basic knowledge in Javascript, CSS, and HTML. Some good resources are:

The frontend uses the following main libraries:

Component Architecture

In the following section, you will find some UML class diagrams describing the implementation of some parts of the frontend.

Plugins

UML

Plugins

(1) The plugin log text is updated every second inside the pluginController.

Databases

UML

Databases

(2) Sends a stop event before adding a database to AppDrawer. AppDrawer will change the workload indicator.
(3) Call to stop worker if a database is added.
(4) If for example a database is added the Service will emit that a database is added to the event bus (ADD_DATABASE). The DatabaseController will listen for this event. The Eventbus will manipulate the Controller (attributes) if an event occurs.
(5) Use to get the new database information from the service (For example if the eventBus has a DATABASE_ADDED event)

WorkloadGeneration

UML

WorkloadGeneration

(6) Changes Workload Indicator in AppDrawer and sets attributes worker running.
(7) WorkloadGenerator updates Workload information. For example which workload is loaded.
(8) A workload is defined and communicated with a string like: TPCH SF 1.
(9) No WorkloadController exists.
(10) If we select a workload ([x] TPCH ...) the WorkloadGenerator tells the WorkloadService to start the generation with an empty weight dict. The dict is defining the weights (for example {"query 1": 88}). Then getWorkload from the Service gets called to get the default weights from the backend. The default weights are then used by the QueryWeights Component to display the sliders and change the weights. The QueryWeights Component then emit a change weight event if the weights are changed by the user (sliders).
(11) The sliders all have an index. It is used to identify the method to change. A workload gets an index as well. These indexes of the slider a workloads describe the frequency change of the workload generation.

SelectionList

UML

SelectionList

(12) If the range is selected it sets it directly in the Controller. That's all. The Graphs seem to use the range directly from the controller.
(13) The following is happening when ResetTimeRange is called: emitStaticRangeChangedEvent is called -> emitStaticRangeChange in mete/Event is called -> Inside this call Bus.$emit("STATIC_RANGE_CHANGED") is called -> The event is catched by the SelectionController -> the SelectionController sets the range values.

InstanceComparison

instance_comparrison_screen

UML

InstanceComparison

(14) Get relevant metric attributes from MetricController . SetIntervall() will update these values inside the controller.
(15) (In Overview if database is deselected/ selected) The data (for example throughput) is coming from metricController -> meta components -> Throughput -> Linechart (props: data). The chart watches the databaseUpdated attribute inside the databaseController. If it is true it updates the plot witch the data from the MetricsController. It accesses the selected range from the RangeController to get the right layout.