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

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-goapi.git


The following commit(s) were added to refs/heads/main by this push:
     new c447cf3  Adding metrics v3 related query protocols (#59)
c447cf3 is described below

commit c447cf3e110cfcba39ff1bcb72507bb75b562c75
Author: mrproliu <[email protected]>
AuthorDate: Tue Jun 6 07:27:25 2023 +0000

    Adding metrics v3 related query protocols (#59)
---
 dependencies.sh |  2 +-
 query/schema.go | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 92 insertions(+), 3 deletions(-)

diff --git a/dependencies.sh b/dependencies.sh
index ac9be0d..398fb60 100644
--- a/dependencies.sh
+++ b/dependencies.sh
@@ -18,7 +18,7 @@
 # under the License.
 
 export COLLECT_PROTOCOL_SHA=0da9c8b3e111fb51c9f8854cae16d4519462ecfe
-export QUERY_PROTOCOL_SHA=c051e82dbef00a160210ecd65911ee27dce253bf
+export QUERY_PROTOCOL_SHA=957b0120af74dde1b2fca2449914739bd97c435f
 export ENVOY_SERVICE_PROTOCOL_SHA=533b32f1b390a3a88ec2008d0561e07c926d879a
 export XDS_SERVICE_PROTOCOL_SHA=25de7278fc844d392d607214f36dbedf50f167ee
 export PROTOC_VALIDATE_SHA=v0.6.1
diff --git a/query/schema.go b/query/schema.go
index b245e7e..2104d46 100644
--- a/query/schema.go
+++ b/query/schema.go
@@ -91,6 +91,24 @@ type Call struct {
        DetectPoints     []DetectPoint `json:"detectPoints"`
 }
 
+type ContinuousProfilingMonitoringInstance struct {
+       ID                   string                                  `json:"id"`
+       Name                 string                                  
`json:"name"`
+       Attributes           []*Attribute                            
`json:"attributes"`
+       TriggeredCount       int                                     
`json:"triggeredCount"`
+       LastTriggerTimestamp *int64                                  
`json:"lastTriggerTimestamp,omitempty"`
+       Processes            []*ContinuousProfilingMonitoringProcess 
`json:"processes"`
+}
+
+type ContinuousProfilingMonitoringProcess struct {
+       ID                   string   `json:"id"`
+       Name                 string   `json:"name"`
+       DetectType           string   `json:"detectType"`
+       Labels               []string `json:"labels"`
+       TriggeredCount       int      `json:"triggeredCount"`
+       LastTriggerTimestamp *int64   `json:"lastTriggerTimestamp,omitempty"`
+}
+
 type ContinuousProfilingPolicyCreation struct {
        ServiceID string                                     `json:"serviceId"`
        Targets   []*ContinuousProfilingPolicyTargetCreation `json:"targets"`
@@ -115,8 +133,10 @@ type ContinuousProfilingPolicyItemCreation struct {
 }
 
 type ContinuousProfilingPolicyTarget struct {
-       Type       ContinuousProfilingTargetType    `json:"type"`
-       CheckItems []*ContinuousProfilingPolicyItem `json:"checkItems"`
+       Type                 ContinuousProfilingTargetType    `json:"type"`
+       CheckItems           []*ContinuousProfilingPolicyItem 
`json:"checkItems"`
+       TriggeredCount       int                              
`json:"triggeredCount"`
+       LastTriggerTimestamp *int64                           
`json:"lastTriggerTimestamp,omitempty"`
 }
 
 type ContinuousProfilingPolicyTargetCreation struct {
@@ -327,6 +347,12 @@ type Events struct {
        Events []*Event `json:"events"`
 }
 
+type ExpressionResult struct {
+       Type    ExpressionResultType `json:"type"`
+       Results []*MQEValues         `json:"results"`
+       Error   *string              `json:"error,omitempty"`
+}
+
 type HealthStatus struct {
        Score   int     `json:"score"`
        Details *string `json:"details,omitempty"`
@@ -426,6 +452,22 @@ type Logs struct {
        Logs        []*Log  `json:"logs"`
 }
 
+type MQEValue struct {
+       ID      *string `json:"id,omitempty"`
+       Value   *string `json:"value,omitempty"`
+       TraceID *string `json:"traceID,omitempty"`
+}
+
+type MQEValues struct {
+       Metric *Metadata   `json:"metric,omitempty"`
+       Values []*MQEValue `json:"values"`
+}
+
+type Metadata struct {
+       Name   string      `json:"name"`
+       Labels []*KeyValue `json:"labels"`
+}
+
 type MetricCondition struct {
        Name string  `json:"name"`
        ID   *string `json:"id,omitempty"`
@@ -1228,6 +1270,53 @@ func (e EventType) MarshalGQL(w io.Writer) {
        fmt.Fprint(w, strconv.Quote(e.String()))
 }
 
+type ExpressionResultType string
+
+const (
+       ExpressionResultTypeUnknown          ExpressionResultType = "UNKNOWN"
+       ExpressionResultTypeSingleValue      ExpressionResultType = 
"SINGLE_VALUE"
+       ExpressionResultTypeTimeSeriesValues ExpressionResultType = 
"TIME_SERIES_VALUES"
+       ExpressionResultTypeSortedList       ExpressionResultType = 
"SORTED_LIST"
+       ExpressionResultTypeRecordList       ExpressionResultType = 
"RECORD_LIST"
+)
+
+var AllExpressionResultType = []ExpressionResultType{
+       ExpressionResultTypeUnknown,
+       ExpressionResultTypeSingleValue,
+       ExpressionResultTypeTimeSeriesValues,
+       ExpressionResultTypeSortedList,
+       ExpressionResultTypeRecordList,
+}
+
+func (e ExpressionResultType) IsValid() bool {
+       switch e {
+       case ExpressionResultTypeUnknown, ExpressionResultTypeSingleValue, 
ExpressionResultTypeTimeSeriesValues, ExpressionResultTypeSortedList, 
ExpressionResultTypeRecordList:
+               return true
+       }
+       return false
+}
+
+func (e ExpressionResultType) String() string {
+       return string(e)
+}
+
+func (e *ExpressionResultType) UnmarshalGQL(v interface{}) error {
+       str, ok := v.(string)
+       if !ok {
+               return fmt.Errorf("enums must be strings")
+       }
+
+       *e = ExpressionResultType(str)
+       if !e.IsValid() {
+               return fmt.Errorf("%s is not a valid ExpressionResultType", str)
+       }
+       return nil
+}
+
+func (e ExpressionResultType) MarshalGQL(w io.Writer) {
+       fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
 type Language string
 
 const (

Reply via email to