reportDbStats will report the public rest request specific stats back to the database
()
| 839 | |
| 840 | // reportDbStats will report the public rest request specific stats back to the database |
| 841 | func (h *handler) reportDbStats() { |
| 842 | if !h.shouldUpdateBytesTransferredStats() { |
| 843 | return |
| 844 | } |
| 845 | var bytesReadStat int64 |
| 846 | h.response.reportStats(true) |
| 847 | // load the number of bytes read on the request |
| 848 | bytesReadStat = h.requestBody.GetBodyBytesCount() |
| 849 | // as this is int64 lets protect against a situation where a negative is returned from GetBodyBytesCount() function and thus decrementing the stat |
| 850 | if bytesReadStat > 0 { |
| 851 | h.db.DbStats.DatabaseStats.PublicRestBytesRead.Add(bytesReadStat) |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | // logStatusWithDuration will log the request status and the duration of the request. |
| 856 | func (h *handler) logStatusWithDuration(status int, message string) { |
no test coverage detected