summaryrefslogtreecommitdiff
path: root/include/fieldstat
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2024-07-12 16:52:25 +0800
committerchenzizhan <[email protected]>2024-07-12 16:52:25 +0800
commitb1bfae446ad29bf607bd0bd146dda2467f02ea72 (patch)
treea3690af59854e63950b73f4673e8c014989b9be2 /include/fieldstat
parent58e206384b2b8e4afb63284f471a64f3b6fe424a (diff)
rename; add some todos
Diffstat (limited to 'include/fieldstat')
-rw-r--r--include/fieldstat/fieldstat.h6
-rw-r--r--include/fieldstat/fieldstat_easy.h6
-rw-r--r--include/fieldstat/fieldstat_exporter.h1
3 files changed, 10 insertions, 3 deletions
diff --git a/include/fieldstat/fieldstat.h b/include/fieldstat/fieldstat.h
index f9dcfda..c121a48 100644
--- a/include/fieldstat/fieldstat.h
+++ b/include/fieldstat/fieldstat.h
@@ -26,7 +26,7 @@ enum metric_type
enum field_type
{
- TAG_INTEGER,
+ TAG_INTEGER, // TODO: rename
TAG_DOUBLE,
TAG_CSTRING,
};
@@ -34,7 +34,7 @@ enum field_type
enum sampling_mode {
SAMPLING_MODE_COMPREHENSIVE,
SAMPLING_MODE_TOPK,
- SAMPLING_MODE_SPREADSKETCH,
+ SAMPLING_MODE_SPREADSKETCH, // TODO: rename TOP_CARDINALITY // todo: 问问gpt cardinality,unique....
};
struct field {
@@ -146,7 +146,7 @@ int fieldstat_hll_add_field(struct fieldstat *instance, int cube_id, int metric_
* @return FS_OK if success. FS_ERR_NULL_HANDLER, FS_ERR_INVALID_CUBE_ID, FS_ERR_INVALID_METRIC_ID if fail.
* FS_ERR_INVALID_PARAM when value is less than 0, or the cube is topk.
*/
-int fieldstat_hist_record(struct fieldstat *instance, int cube_id, int metric_id, const struct field *cell_dimensions, size_t n_dimensions, long long value);
+int fieldstat_hist_record(struct fieldstat *instance, int cube_id, int metric_id, const struct field *cell_dimensions, size_t n_dimensions, long long value); // todo: 重命名,hist,不管符号冲突问题了
/*
* @brief Delete all the cells, also the content of every metrics. The cube and metrics are not deleted. Increase cell_version by 1.
diff --git a/include/fieldstat/fieldstat_easy.h b/include/fieldstat/fieldstat_easy.h
index 62dd5f8..067b43f 100644
--- a/include/fieldstat/fieldstat_easy.h
+++ b/include/fieldstat/fieldstat_easy.h
@@ -73,7 +73,13 @@ int fieldstat_easy_output_array_and_reset(struct fieldstat_easy *fse, char ***js
* @param increment: increment of the counter metric. Can be negative.
* return -1 also when the thread_id is out of range.FS_ERR_INVALID_METRIC_ID metric_id is not registered.
*/
+
int fieldstat_easy_counter_incrby(struct fieldstat_easy *fse, int thread_id, int metric_id, const struct field *dimensions, size_t n_dimensions, long long increment);
+
+// TODO: easy 的加速使用,跟其他人对接一下。包括如何在不改变fieldstat.h 的基础上再来一套接口。
+// int fieldstat_easy_counter_incrby(struct fieldstat_easy *fse, int thread_id, int metric_id, int cell_id, long long increment);
+// int fieldstat_easy_add_cell(struct fieldstat_easy *fse,const struct field *dimensions, size_t n_dimensions);
+
/*
* @brief let the value of counter metric of dimensions equal to `value`.
* for other notes, see fieldstat_easy_counter_incrby.
diff --git a/include/fieldstat/fieldstat_exporter.h b/include/fieldstat/fieldstat_exporter.h
index c11fdff..83e4c37 100644
--- a/include/fieldstat/fieldstat_exporter.h
+++ b/include/fieldstat/fieldstat_exporter.h
@@ -27,6 +27,7 @@ char *fieldstat_json_exporter_export(const struct fieldstat_json_exporter *expor
*/
void fieldstat_json_exporter_export_array(const struct fieldstat_json_exporter *exporter, const struct fieldstat *instance, const struct timeval *timestamp, char ***output, size_t *output_size);
+void fieldstat_json_exporter_export_flat(const struct fieldstat_json_exporter *exporter, const struct fieldstat *instance, const struct timeval *timestamp, char ***output, size_t *output_size);
/*
let json exporter output delta value by the side of the original value(accumulated). If a cell / metric is new, the delta value is the same as the original value.
Outputting delta value is disabled by default.