summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2023-12-11 11:12:57 +0800
committerchenzizhan <[email protected]>2023-12-11 11:12:57 +0800
commita3bd4934eb46e67d76489e2fec597e9cb30a84de (patch)
tree3fd4789202bd552bf75671d543f1a91891a123df /include
parent8cb0a7ede8d30b0e1a49fa1582e26795d5258b27 (diff)
feat: query cube modev4.4.3
Diffstat (limited to 'include')
-rw-r--r--include/fieldstat/fieldstat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/fieldstat/fieldstat.h b/include/fieldstat/fieldstat.h
index 4832a06..e5c14e1 100644
--- a/include/fieldstat/fieldstat.h
+++ b/include/fieldstat/fieldstat.h
@@ -67,6 +67,7 @@ int fieldstat_calibrate(const struct fieldstat *master, struct fieldstat *replic
* @return cube id, if success; otherwise, return FS_ERR_NULL_HANDLER, or FS_ERR_INVALID_PARAM when (max_n_cell == 0 && mode == TOPK). return FS_ERR_INVALID_KEY when the shared_tags is not unique.
*/
int fieldstat_create_cube(struct fieldstat *instance, const struct fieldstat_tag *shared_tags, size_t n_tag, enum sampling_mode mode, size_t max_n_cell);
+
/*
@brief Change the topk cube primary metric id. When fieldstat_counter_add or fieldstat_counter_set are called on the primary metric, the topk record of such cell will be updated.
the default primary metric id is 0.
@@ -224,6 +225,13 @@ struct fieldstat_tag_list *fieldstat_get_shared_tags(const struct fieldstat *ins
*/
int fieldstat_find_cube(const struct fieldstat *instance, const struct fieldstat_tag *shared_tags, size_t n_shared_tags);
+/*
+ return FS_ERR_NULL_HANDLER, FS_ERR_INVALID_CUBE_ID if fail.
+ When return OK, mode == COMPREHENSIVE, primary_metric_id == -1.
+ When return OK, mode == TOPK, primary_metric_id >= 0.
+*/
+int fieldstat_get_cube_mode(const struct fieldstat *instance, int cube_id, enum sampling_mode *mode, int *primary_metric_id);
+
/*
get the cell numbers in a cube. Return FS_ERR_INVALID_CUBE_ID if cube_id is invalid.
*/