You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2022/10/15 01:36:21 UTC

[skywalking-banyandb] 01/01: Add an meausre create operation instrument

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch doc-crud
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git

commit fd0a9703e586c46a772a3bcfc106c1904f6f9f36
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Sat Oct 15 01:34:43 2022 +0000

    Add an meausre create operation instrument
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 docs/crud/measure/schema.md | 80 +++++++++++++++++++++++++++++++++++++++++++++
 docs/crud/measure/write.md  |  7 ----
 2 files changed, 80 insertions(+), 7 deletions(-)

diff --git a/docs/crud/measure/schema.md b/docs/crud/measure/schema.md
new file mode 100644
index 0000000..ec080b5
--- /dev/null
+++ b/docs/crud/measure/schema.md
@@ -0,0 +1,80 @@
+# CRUD Measures
+
+CRUD operations create, read, update and delete measures.
+
+## Create operation
+
+Create operation adds a new measure to the database's metadata registry repository. If the measure does not currently exist, create operation will create the schema.
+
+### Examples
+
+`bydbctl` is the command line tool to create a measure in this example.
+
+A measure belongs to a unique group. We should create such a group with a catalog `CATALOG_MEASURE`
+before creating a measure.
+
+```shell
+$ bydbctl group create -f - <<EOF
+metadata:
+  name: sw_metric
+catalog: CATALOG_MEASURE
+resource_opts:
+  shard_num: 2
+  block_interval:
+    unit: UNIT_HOUR
+    num: 2
+  segment_interval:
+    unit: UNIT_DAY
+    num: 1
+  ttl:
+    unit: UNIT_DAY
+    num: 7
+EOF
+```
+
+The group creates two shards to store measure data points. Every one day, it would create a
+segment which will generate a block every 2 hours.
+
+The data in this group will keep 7 days.
+
+Then, below command will create a new measure:
+
+```shell
+$ bydbctl measure create -f - <<EOF
+metadata:
+  name: service_cpm_minute
+  group: sw_metric
+tag_families:
+- name: default
+  tags:
+  - name: id
+    type: TAG_TYPE_ID
+  - name: entity_id
+    type: TAG_TYPE_STRING
+fields:
+- name: total
+  field_type: FIELD_TYPE_INT
+  encoding_method: ENCODING_METHOD_GORILLA
+  compression_method: COMPRESSION_METHOD_ZSTD
+- name: value
+  field_type: FIELD_TYPE_INT
+  encoding_method: ENCODING_METHOD_GORILLA
+  compression_method: COMPRESSION_METHOD_ZSTD
+entity:
+  tag_names:
+  - entity_id
+interval: 1m
+EOF
+```
+
+`service_cpm_minute` expect to ingest a series of data points with one minute interval.
+
+## Read operation
+
+## Update operation
+
+## Delete operation
+
+## API Reference
+
+[MeasureService v1](../../api-reference.md#measureservice)
diff --git a/docs/crud/measure/write.md b/docs/crud/measure/write.md
deleted file mode 100644
index 727c626..0000000
--- a/docs/crud/measure/write.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Write and Update Measures
-
-## Examples
-
-## API Reference
-
-[MeasureService v1](../../api-reference.md#measureservice)