Stats builder for ioclass statistics.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-08-26 07:23:05 -04:00
parent 2450d3da4b
commit f9da89263b
4 changed files with 259 additions and 33 deletions

View File

@@ -62,15 +62,6 @@ struct ocf_stats_block {
* Statistics appropriate for given IO class
*/
struct ocf_stats_io_class {
/** Read requests statistics */
struct ocf_stats_req read_reqs;
/** Writes requests statistics */
struct ocf_stats_req write_reqs;
/** Block requests statistics */
struct ocf_stats_block blocks;
/** Number of cache lines available for given partition */
uint64_t free_clines;
@@ -79,6 +70,21 @@ struct ocf_stats_io_class {
/** Number of dirty cache lines assigned to specific partition */
uint64_t dirty_clines;
/** Read requests statistics */
struct ocf_stats_req read_reqs;
/** Writes requests statistics */
struct ocf_stats_req write_reqs;
/** Block requests submitted by user to this core */
struct ocf_stats_block blocks;
/** Block requests for cache volume statistics */
struct ocf_stats_block cache_blocks;
/** Block requests for core volume statistics */
struct ocf_stats_block core_blocks;
};
#define IO_PACKET_NO 12

View File

@@ -172,7 +172,7 @@ int ocf_stats_collect_cache(ocf_cache_t cache,
/**
* @param Collect statistics for given core
*
* @param cache Core for each statistics will be collected
* @param core Core for which statistics will be collected
* @param usage Usage statistics
* @param req Request statistics
* @param blocks Blocks statistics
@@ -187,4 +187,36 @@ int ocf_stats_collect_core(ocf_core_t core,
struct ocf_stats_blocks *blocks,
struct ocf_stats_errors *errors);
/**
* @param Collect statistics for given ioclass
*
* @param core Core handle for which statistics will be collected
* @param part_id Ioclass id for which statistics will be collected
* @param usage Usage statistics
* @param req Request statistics
* @param blocks Blocks statistics
*
* @retval 0 Success
* @retval Non-zero Error
*/
int ocf_stats_collect_part_core(ocf_core_t core, ocf_part_id_t part_id,
struct ocf_stats_usage *usage, struct ocf_stats_requests *req,
struct ocf_stats_blocks *blocks);
/**
* @param Collect statistics for given ioclass
*
* @param cache Cache instance for which statistics will be collected
* @param part_id Ioclass id for which statistics will be collected
* @param usage Usage statistics
* @param req Request statistics
* @param blocks Blocks statistics
*
* @retval 0 Success
* @retval Non-zero Error
*/
int ocf_stats_collect_part_cache(ocf_cache_t cache, ocf_part_id_t part_id,
struct ocf_stats_usage *usage, struct ocf_stats_requests *req,
struct ocf_stats_blocks *blocks);
#endif /* __OCF_STATS_BUILDER_H__ */