Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Resource Usage Grapher | Monitoring and Log Analysis
Python for DevOps Beginners

bookChallenge: Resource Usage Grapher

Visualizing resource trends is a key skill for anticipating system needs and planning capacity upgrades. By plotting resource usage data—like memory consumption—over time, you can quickly spot spikes, patterns, and potential bottlenecks. This challenge asks you to create a Python script that uses the matplotlib library to plot memory usage from a hardcoded list, label the axes, and add a descriptive title. This kind of visualization is essential for DevOps professionals who need to monitor systems and plan for future growth.

Task

Swipe to start coding

Write a script that visualizes memory usage data over time using matplotlib.

  • Plot the values in memory_usage as a line graph.
  • Use the x-axis to represent time points (use the index of each value).
  • Label the x-axis as "Time (minutes)".
  • Label the y-axis as "Memory Usage (MB)".
  • Add the title "Memory Usage Over Time" to the plot.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Resource Usage Grapher

Swipe to show menu

Visualizing resource trends is a key skill for anticipating system needs and planning capacity upgrades. By plotting resource usage data—like memory consumption—over time, you can quickly spot spikes, patterns, and potential bottlenecks. This challenge asks you to create a Python script that uses the matplotlib library to plot memory usage from a hardcoded list, label the axes, and add a descriptive title. This kind of visualization is essential for DevOps professionals who need to monitor systems and plan for future growth.

Task

Swipe to start coding

Write a script that visualizes memory usage data over time using matplotlib.

  • Plot the values in memory_usage as a line graph.
  • Use the x-axis to represent time points (use the index of each value).
  • Label the x-axis as "Time (minutes)".
  • Label the y-axis as "Memory Usage (MB)".
  • Add the title "Memory Usage Over Time" to the plot.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

some-alt