Monitoring and optimizing the cost of the infrastructure