Monitoring Availability Groups can be tricky. The DMVs don’t update the log_send_rate and redo_rate all the time especially if nothing is happening so if you try to use those for calculations when monitoring you could false results worse yet pages in the middle of the night. In order to calculate the log_send_rate
Update: From time to time I get questions on this blog post and since I have wrote it dbatools has come out with method do this and if you have not checked out dbatools you should. Click here to get started with dbatools and here (Invoke-DbaQuery) to see the function