#include <userver/cache/cache_statistics.hpp>
Allows a specific cache to fill cache statistics during an Update.
If Update returns without throwing an exception and without calling one of the Finish* methods, the behavior is undefined.
See components::CachingComponentBase::Set() for information on actual cache update, rather than statistics update.
Definition at line 55 of file cache_statistics.hpp.
Public Member Functions | |
| void | Finish (std::size_t total_documents_count) |
Mark that the Update has finished with changes. | |
| void | FinishNoChanges () |
Mark that the Update has finished without changes. | |
| void | FinishWithError () |
Mark that the Update failed. | |
| void | IncreaseDocumentsReadCount (std::size_t add) |
| Each item received from the data source should be accounted with this function. | |
| void | IncreaseDocumentsParseFailures (std::size_t add) |
| Each received item that failed validation should be accounted with this function, in addition to IncreaseDocumentsReadCount. | |
| void cache::UpdateStatisticsScope::Finish | ( | std::size_t | total_documents_count | ) |
Mark that the Update has finished with changes.
| total_documents_count | the new total number of items stored in the cache |
| void cache::UpdateStatisticsScope::IncreaseDocumentsParseFailures | ( | std::size_t | add | ) |
Each received item that failed validation should be accounted with this function, in addition to IncreaseDocumentsReadCount.
Update | add | the number of non-valid items newly received |
| void cache::UpdateStatisticsScope::IncreaseDocumentsReadCount | ( | std::size_t | add | ) |
Each item received from the data source should be accounted with this function.
Update | add | the number of items (both valid and non-valid) newly received |