You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/10/14 09:42:57 UTC

[GitHub] [skywalking-banyandb] hanahmily opened a new pull request #57: Add measure and topN APIs

hanahmily opened a new pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57


   In this PR, I introduced 
    * The measure query and write APIs
    * TopN offline statistics specification
    * TopN query APIs
   
   The measure-relevant APIs are easy to follow. Please refer to the comments to review them. 
   
   Here I will use some examples to represent how to use TopN APIs
   
   ## TopN Examples
   
   Firstly, I should define a `TopNAggregation` to generate offline statistics:
   
   ```yaml
   metadata:
     name: service_cpm
     group: default
   source_measure: 
     name: cpm
     group: default
   field_name: value
   field_value_sort: DESC
   // data points from service scope will ignore "service_id"
   group_by_tag_names: ["scope", "service_id"] 
   ...
   ```
   
   Then building a `TopNRequest` to fetch the top 10 services based on above statistics:
   
   ```yaml
   metadata:
     name: service_cpm
     group: default
   time_range: [start, end]
   top_n: 10
   agg: MEAN
   conditions:
   - name: scope
      op: Equal
      value: "service"
   ```
   
   or to fetch the top 10 instances of a service:
   
   ```yaml
   metadata:
     name: service_cpm
     group: default
   time_range: [start, end]
   top_n: 10
   agg: MEAN
   conditions:
   - name: scope
      op: Equal
      value: "service"
   - name: service_id
      op: Equal
      value: xxxx
   ```
   
   At the same time, users could use a different strategy from above: splitting service, endpoints, and instances statistics into several by the criteria property on `TopNAggregation`
   
   @lujiajing1126 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731736528



##########
File path: api/proto/banyandb/model/v1/common.proto
##########
@@ -54,3 +54,12 @@ message TagValue {
 message TagFamilyForWrite {
     repeated TagValue tags = 1;
 }
+
+message FieldValue {

Review comment:
       Do we need to add float type?
   
   Besides, maybe a stupid question, in which circumstances do we need binary and string type measure?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741899656



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be remove?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731964186



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,12 +122,34 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    ResourceOpts opts = 5;
+    // updated_at_nanoseconds indicates when the measure is updated
+    google.protobuf.Timestamp updated_at_nanoseconds = 6;
+}
+
+// TopNAggregation generates offline TopN statistics for a measure's TopN approximation
+message TopNAggregation {
+    // metadata is the identity of an aggregation
+    common.v1.Metadata metadata = 1;
+    // source_measure denotes the data source of this aggregation
+    common.v1.Metadata source_measure = 2;
+    // field_name is the name of field used for ranking
+    string field_name = 3;
+    // field_value_sort indicates how to sort fields
+    // ASC: bottomN
+    // DESC: topN
+    // UNSPECIFIED: topN + bottomN
+    model.v1.Sort field_value_sort = 4;
+    // group_by_tag_names groups data points into statistical counters
+    repeated string group_by_tag_names = 5;
+    // criteria select partial data points from measure
+    repeated model.v1.Criteria criteria = 6;
+    // counters_number sets the number of counters to be tracked. The default value is 1000
+    int32 counters_number = 7;

Review comment:
       It denotes how many metric entities will be pre-calculated in each time bucket. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] wu-sheng edited a comment on pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
wu-sheng edited a comment on pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#issuecomment-943195348


   What is source_measure? and what does agg: MEAN mean?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741899656



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be removed?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731711178



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -0,0 +1,75 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_package = "org.apache.skywalking.banyandb.measure.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/measure/v1";
+
+package banyandb.measure.v1;
+
+import "google/protobuf/timestamp.proto";
+import "banyandb/common/v1/common.proto";
+import "banyandb/model/v1/common.proto";
+import "banyandb/model/v1/query.proto";
+
+// DataPoint is stored in Measures
+message DataPoint {
+  // timestamp is in the timeunit of nanoseconds.
+  google.protobuf.Timestamp timestamp = 1;
+  // tag_families contains tags selected in the projection
+  repeated model.v1.TagFamily tag_families = 2;
+  message Field {
+    string name = 1;
+    model.v1.FieldValue value = 2;
+  }
+  // fields contains fields selected in the projection
+  repeated Field fields = 3;
+}
+
+// QueryResponse is the response for a query to the Query module.
+message QueryResponse {
+  // data_points are the actual data returned
+  repeated DataPoint data_points = 1;
+}
+
+// QueryRequest is the request contract for query.
+message QueryRequest {
+  // metadata is required
+  common.v1.Metadata metadata = 1;
+  // time_range is a range query with begin/end time of entities in the timeunit of nanoseconds.
+  model.v1.TimeRange time_range = 2;
+  // offset is used to support pagination, together with the following limit
+  uint32 offset = 3;
+  // limit is used to impose a boundary on the number of records being returned
+  uint32 limit = 4;
+  // order_by is given to specify the sort for a field. So far, only fields in the type of Integer are supported
+  model.v1.QueryOrder order_by = 5;

Review comment:
       Do we need paging and order by in the context of `Measure`?
   
   https://github.com/apache/skywalking-query-protocol/blob/master/metrics-v2.graphqls
   
   It seems there is no such semantics in metrics query.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731697707



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,12 +122,34 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    ResourceOpts opts = 5;
+    // updated_at_nanoseconds indicates when the measure is updated
+    google.protobuf.Timestamp updated_at_nanoseconds = 6;
+}
+
+// TopNAggregation generates offline TopN statistics for a measure's TopN approximation

Review comment:
       As I understand `offline` means the aggregation will be done when and only when it is requested, right?
   
   So this is in contrary to the `TopNStreamProcessor` in OAP.

##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,12 +122,34 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    ResourceOpts opts = 5;
+    // updated_at_nanoseconds indicates when the measure is updated
+    google.protobuf.Timestamp updated_at_nanoseconds = 6;
+}
+
+// TopNAggregation generates offline TopN statistics for a measure's TopN approximation
+message TopNAggregation {
+    // metadata is the identity of an aggregation
+    common.v1.Metadata metadata = 1;
+    // source_measure denotes the data source of this aggregation
+    common.v1.Metadata source_measure = 2;
+    // field_name is the name of field used for ranking
+    string field_name = 3;
+    // field_value_sort indicates how to sort fields
+    // ASC: bottomN
+    // DESC: topN
+    // UNSPECIFIED: topN + bottomN
+    model.v1.Sort field_value_sort = 4;
+    // group_by_tag_names groups data points into statistical counters
+    repeated string group_by_tag_names = 5;
+    // criteria select partial data points from measure
+    repeated model.v1.Criteria criteria = 6;
+    // counters_number sets the number of counters to be tracked. The default value is 1000
+    int32 counters_number = 7;

Review comment:
       What do you mean by the "counter" number?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741749826



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,14 +135,39 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    // interval_rules define data points writing interval
+    repeated IntervalRule interval_rules = 5;

Review comment:
       @wu-sheng As we discussed, interval_rules instrument how frequently data points in a series are written? @lujiajing1126 we should add a new tag in the java client to match these rules.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#issuecomment-943262314


   > What is source_measure? and what does agg: MEAN mean?
   
   https://github.com/apache/skywalking-banyandb/blob/b2e6982fcd05d4b4f532cfaecb03c24d97f63a2a/api/proto/banyandb/database/v1/schema.proto#L134-L135
   
   https://github.com/apache/skywalking-banyandb/blob/b2e6982fcd05d4b4f532cfaecb03c24d97f63a2a/api/proto/banyandb/measure/v1/topn.proto#L62-L63
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741749826



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,14 +135,39 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    // interval_rules define data points writing interval
+    repeated IntervalRule interval_rules = 5;

Review comment:
       @wu-sheng As we discussed, interval_rules instrument how frequently data points in a series are written? @lujiajing1126 we should add a new tag in the java client to match these rules.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] wu-sheng merged pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731973992



##########
File path: api/proto/banyandb/model/v1/common.proto
##########
@@ -54,3 +54,12 @@ message TagValue {
 message TagFamilyForWrite {
     repeated TagValue tags = 1;
 }
+
+message FieldValue {

Review comment:
       As we discussed in `Stream` design, skywalking doesn't support `float` for now. But the floating-point number is still in our plan, we could discuss this topic in the next iteration. 
   
   Skywalking has some composited data values, for example, labeled, histogram and etc. They are encoded to the `string` for now. The binary type brings us more flexibility to deal with some unknown scenarios.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741749826



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,14 +135,39 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    // interval_rules define data points writing interval
+    repeated IntervalRule interval_rules = 5;

Review comment:
       @wu-sheng As we discussed, interval_rules instrument how frequently data points in a series are written? @lujiajing1126 we should add a new tag in the java client to match these rules.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741899656



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be remove?

##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be removed?

##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be remove?

##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be removed?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731961195



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,12 +122,34 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    ResourceOpts opts = 5;
+    // updated_at_nanoseconds indicates when the measure is updated
+    google.protobuf.Timestamp updated_at_nanoseconds = 6;
+}
+
+// TopNAggregation generates offline TopN statistics for a measure's TopN approximation

Review comment:
       NO. each measure written could trigger the offline statistics generation.
   
   `TopNStreamProcessor` would output records that should be in the `Stream` model.  




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741749826



##########
File path: api/proto/banyandb/database/v1/schema.proto
##########
@@ -116,14 +135,39 @@ message Measure {
     repeated FieldSpec fields = 3;
     // entity indicates which tags will be to generate a series and shard a measure
     Entity entity = 4;
-    // shard_num is the number of shards
-    uint32 shard_num = 5;
-    // ttl indicates time to live, how long the data will be cached
-    Duration ttl = 6;
+    // interval_rules define data points writing interval
+    repeated IntervalRule interval_rules = 5;

Review comment:
       @wu-sheng As we discussed, interval_rules instrument how frequently data points in a series are written? @lujiajing1126 we should add a new tag in the java client to match these rules.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] wu-sheng commented on pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#issuecomment-943195348


   What is source_measure? and what does agg: MEANmean?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r731966114



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -0,0 +1,75 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_package = "org.apache.skywalking.banyandb.measure.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/measure/v1";
+
+package banyandb.measure.v1;
+
+import "google/protobuf/timestamp.proto";
+import "banyandb/common/v1/common.proto";
+import "banyandb/model/v1/common.proto";
+import "banyandb/model/v1/query.proto";
+
+// DataPoint is stored in Measures
+message DataPoint {
+  // timestamp is in the timeunit of nanoseconds.
+  google.protobuf.Timestamp timestamp = 1;
+  // tag_families contains tags selected in the projection
+  repeated model.v1.TagFamily tag_families = 2;
+  message Field {
+    string name = 1;
+    model.v1.FieldValue value = 2;
+  }
+  // fields contains fields selected in the projection
+  repeated Field fields = 3;
+}
+
+// QueryResponse is the response for a query to the Query module.
+message QueryResponse {
+  // data_points are the actual data returned
+  repeated DataPoint data_points = 1;
+}
+
+// QueryRequest is the request contract for query.
+message QueryRequest {
+  // metadata is required
+  common.v1.Metadata metadata = 1;
+  // time_range is a range query with begin/end time of entities in the timeunit of nanoseconds.
+  model.v1.TimeRange time_range = 2;
+  // offset is used to support pagination, together with the following limit
+  uint32 offset = 3;
+  // limit is used to impose a boundary on the number of records being returned
+  uint32 limit = 4;
+  // order_by is given to specify the sort for a field. So far, only fields in the type of Integer are supported
+  model.v1.QueryOrder order_by = 5;

Review comment:
       Fine, I will remove this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #57: Add measure and topN APIs

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #57:
URL: https://github.com/apache/skywalking-banyandb/pull/57#discussion_r741899656



##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be remove?

##########
File path: api/proto/banyandb/measure/v1/query.proto
##########
@@ -55,21 +55,17 @@ message QueryRequest {
   model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;

Review comment:
       offset should also be removed?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org