Skip to content

Commit

Permalink
Fix current usage value of process CPU and sync CLI (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Jun 13, 2023
1 parent 606d8eb commit 87c63a1
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/profiling/continuous/checker/process_cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (r *ProcessCPUChecker) Init(config *base.ContinuousConfig) error {
if err != nil {
return 0, err
}
return percent * 100, nil
return percent, nil
}, v3.ContinuousProfilingTriggeredMonitorType_ProcessCPU)
return nil
}
4 changes: 2 additions & 2 deletions test/e2e/base/env
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SW_CTL_COMMIT=f3eed66ee2ff330e3218fdc995b6f9952901e37c
SW_OAP_COMMIT=d88d887a32f791d0670e4e8d5c2fd615126234cf
SW_CTL_COMMIT=6b2eb0011e38b630db6af7203db215806bd141ed
SW_OAP_COMMIT=43668b7655ce4c5a95b87267be4c3b962d1eea38
SW_KUBERNETES_COMMIT_SHA=0f3ec68e5a7e1608cec8688716b848ed15e971e5

SW_AGENT_GO_COMMIT=216f122d942cb683f48578d3014cc5ea83637582
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
count: 1
urilist:
- /provider
uriregex: null
uriregex: null
triggeredcount: {{ ge (index . 0).triggeredcount 1 }}
lasttriggertimestamp: {{ ge (index . 0).lasttriggertimestamp 1 }}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
uripath: /provider
threshold: 50000
current: {{ ge (index .continuousprofilingcauses 0).uri.current 1 }}
message: {{ notEmpty (index .continuousprofilingcauses 0).message }}
targettype: NETWORK
createtime: {{ ge .createtime 1 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
count: 1
urilist:
- /provider
uriregex: null
uriregex: null
triggeredcount: {{ ge (index . 0).triggeredcount 1 }}
lasttriggertimestamp: {{ ge (index . 0).lasttriggertimestamp 1 }}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
uripath: /provider
threshold: 1000
current: {{ ge (index .continuousprofilingcauses 0).uri.current 1 }}
message: {{ notEmpty (index .continuousprofilingcauses 0).message }}
targettype: NETWORK
createtime: {{ ge .createtime 1 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
period: 10
count: 3
urilist: []
uriregex: null
uriregex: null
triggeredcount: {{ ge (index . 0).triggeredcount 1 }}
lasttriggertimestamp: {{ ge (index . 0).lasttriggertimestamp 1 }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
threshold: 1000
current: {{ ge (index .continuousprofilingcauses 0).singlevalue.current 1 }}
uri: null
message: {{ notEmpty (index .continuousprofilingcauses 0).message }}
targettype: ON_CPU
createtime: {{ ge .createtime 1 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
period: 10
count: 3
urilist: []
uriregex: null
uriregex: null
triggeredcount: {{ ge (index . 0).triggeredcount 1 }}
lasttriggertimestamp: {{ ge (index . 0).lasttriggertimestamp 1 }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
threshold: 500
current: {{ ge (index .continuousprofilingcauses 0).singlevalue.current 1 }}
uri: null
message: {{ notEmpty (index .continuousprofilingcauses 0).message }}
targettype: ON_CPU
createtime: {{ ge .createtime 1 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

0 comments on commit 87c63a1

Please sign in to comment.