Skip to content

Commit

Permalink
Merge pull request Open-CAS#253 from mmichal10/stats-refactor
Browse files Browse the repository at this point in the history
Stats builder for ioclasses
  • Loading branch information
micrakow committed Sep 10, 2019
2 parents 9a46c40 + e6f032c commit 29c1c7f
Show file tree
Hide file tree
Showing 25 changed files with 826 additions and 528 deletions.
1 change: 0 additions & 1 deletion inc/ocf.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "ocf_metadata_updater.h"
#include "ocf_io_class.h"
#include "ocf_stats.h"
#include "ocf_stats_builder.h"
#include "ocf_mngt.h"
#include "ocf_ctx.h"
#include "ocf_err.h"
Expand Down
37 changes: 37 additions & 0 deletions inc/ocf_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@
#include "ocf_io.h"
#include "ocf_mngt.h"

struct ocf_core_info {
/** Core size in cache line size unit */
uint64_t core_size;

/** Core size in bytes unit */
uint64_t core_size_bytes;

/** Fields refers ongoing flush operation */
struct {
/** Number of blocks flushed in ongoing flush operation */
uint32_t flushed;

/** Number of blocks left to flush in ongoing flush operation */
uint32_t dirty;
};

/** How long core is dirty in seconds unit */
uint32_t dirty_for;

/** Sequential cutoff threshold (in bytes) */
uint32_t seq_cutoff_threshold;

/** Sequential cutoff policy */
ocf_seq_cutoff_policy seq_cutoff_policy;
};

/**
* @brief Get OCF core by name
*
Expand Down Expand Up @@ -202,4 +228,15 @@ typedef int (*ocf_core_visitor_t)(ocf_core_t core, void *cntx);
int ocf_core_visit(ocf_cache_t cache, ocf_core_visitor_t visitor, void *cntx,
bool only_opened);

/**
* @brief Get info of given core object
*
* @param[in] core Core object
* @param[out] info Core info structure
*
* @retval 0 Success
* @retval Non-zero Fail
*/
int ocf_core_get_info(ocf_core_t core, struct ocf_core_info *info);

#endif /* __OCF_CORE_H__ */
Loading

0 comments on commit 29c1c7f

Please sign in to comment.