0
0
SCADA systemsdevops~5 mins

KPI dashboards in SCADA systems - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: KPI dashboards
O(n)
Understanding Time Complexity

When building KPI dashboards in SCADA systems, it is important to understand how the time to update and display data grows as more data points are added.

We want to know how the system handles larger amounts of data and how that affects performance.

Scenario Under Consideration

Analyze the time complexity of the following code snippet.


// Fetch and display KPI values
function updateDashboard(kpiList) {
  for (let i = 0; i < kpiList.length; i++) {
    let kpi = kpiList[i];
    let value = fetchKPIValue(kpi.id);
    displayValue(kpi.id, value);
  }
}

// fetchKPIValue and displayValue are simple functions

This code updates the dashboard by fetching and displaying each KPI value one by one.

Identify Repeating Operations

Identify the loops, recursion, array traversals that repeat.

  • Primary operation: Looping through the list of KPIs to fetch and display each value.
  • How many times: Once for each KPI in the list (kpiList.length times).
How Execution Grows With Input

As the number of KPIs increases, the number of fetch and display operations grows directly with it.

Input Size (n)Approx. Operations
1010 fetch and display calls
100100 fetch and display calls
10001000 fetch and display calls

Pattern observation: The work grows in a straight line as the number of KPIs increases.

Final Time Complexity

Time Complexity: O(n)

This means the time to update the dashboard grows directly in proportion to the number of KPIs.

Common Mistake

[X] Wrong: "Fetching all KPIs at once will take the same time as fetching one KPI."

[OK] Correct: Each KPI requires a separate fetch and display operation, so more KPIs mean more work and more time.

Interview Connect

Understanding how dashboard updates scale with data size shows you can think about system performance and user experience, a key skill in real-world DevOps and SCADA work.

Self-Check

"What if we batch fetch all KPI values in one call instead of fetching each separately? How would the time complexity change?"