import pandas as pd
import matplotlib.pyplot as plt

# Load the data
df = pd.read_csv('../data/resources.txt', delimiter="\t")

# Plot the histogram
plt.hist(df['maxCPU'], bins=30, edgecolor='black')

# Add titles and labels
plt.title("Distribution of all tenants \nbased on maximum CPU usage")
plt.xlabel('Max CPU Usage (vCPU)')
plt.ylabel('tenants')

# Save the plot as a PNG file
plt.savefig('../img/nodeCPU.png')

# Show the plot
plt.show()
