未验证 提交 d6f943bb 编写于 作者: W wankai123 提交者: GitHub

Replace e2e cases to e2e-v2: PHP (#7919)

上级 fc0d0e1e
......@@ -24,6 +24,9 @@ on:
schedule:
- cron: '0 18 * * *'
env:
SW_AGENT_JDK_VERSION: 8
concurrency:
group: e2e-php-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
......@@ -42,6 +45,6 @@ jobs:
uses: ./.github/actions/skip
- name: Run E2E Test
if: env.SKIP_CI != 'true'
uses: ./.github/actions/e2e-test
uses: ./.github/actions/infra-e2e-test
with:
test_class: org.apache.skywalking.e2e.PHPE2E
config-file: php/e2e.yaml
......@@ -30,6 +30,7 @@ Release Notes.
* Support `!= null` in OAL engine.
* Add `Message Queue Consuming Count` metric for MQ consuming service and endpoint.
* Add `Message Queue Avg Consuming Latency` metric for MQ consuming service and endpoint.
* Replace e2e cases to e2e-v2: PHP.
#### UI
......
# Licensed to the 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.
# The 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.
version: '2.1'
services:
oap:
extends:
file: ../../script/docker-compose/base-compose.yml
service: oap
ports:
- 12800
php:
image: skyapm/skywalking-php:v3.3.2
networks:
- e2e
ports:
- 8080
environment:
- SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap:11800
depends_on:
provider:
condition: service_started
oap:
condition: service_healthy
volumes:
- ./index.php:/var/www/html/index.php
- ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking.ini
provider:
extends:
file: ../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
condition: service_healthy
networks:
e2e:
# Licensed to the 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.
# The 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.
# This file is used to show how to write configuration files and can be used to test.
setup:
env: compose
file: docker-compose.yml
timeout: 1200
init-system-environment: ../../script/env
steps:
- name: install yq
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
- name: install swctl
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
- name: install etcdctl
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl
trigger:
action: http
interval: 3s
times: 10
url: http://${php_host}:${php_8080}/php/info
method: POST
verify:
# verify with retry strategy
retry:
# max retry count
count: 20
# the interval between two retries, in millisecond.
interval: 3s
cases:
# service list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
expected: expected/service.yml
# service instance list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=php
expected: expected/service-instance-php.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
expected: expected/service-instance-provider.yml
# service endpoint
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=php
expected: expected/service-endpoint-php.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider
expected: expected/service-endpoint-provider.yml
# trace segment list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls --service-name=php
expected: expected/traces-list-php.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls --service-name=e2e-service-provider
expected: expected/traces-list-provider.yml
# trace detail
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $( \
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
| yq e '.traces | select(.[].endpointnames[0]=="/php/info") | .[0].traceids[0]' -
)
expected: expected/trace-info-detail.yml
# dependency service
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=php
expected: expected/dependency-services-php.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-provider
expected: expected/dependency-services-provider.yml
# dependency instance
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=php --dest-service-name=e2e-service-provider
expected: expected/dependency-instance.yml
# service metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service instance metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service endpoint metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=/php/info --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint-name=/php/info --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint-name=/php/info --service-name=php |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service relation metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service-name=php --dest-service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service-name=php --dest-service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service instance relation metrics
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm --instance-name=$( \
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=php | yq e '.[0].name' - ) \
--service-name=php --dest-instance-name=provider1 --dest-service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# Licensed to the 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.
# The 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.
nodes:
{{- contains .nodes }}
- id: {{ notEmpty .id }}
name: {{ notEmpty .name }}
serviceid: {{ b64enc "php" }}.1
servicename: php
type: ""
isreal: true
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
name: provider1
serviceid: {{ b64enc "e2e-service-provider" }}.1
servicename: e2e-service-provider
type: Tomcat
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ notEmpty .source }}
sourcecomponents: []
target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
targetcomponents: []
id: {{ notEmpty .id }}
detectpoints:
- CLIENT
- SERVER
{{- end }}
# Licensed to the 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.
# The 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.
nodes:
{{- contains .nodes }}
- id: {{ b64enc "User" }}.0
name: User
type: USER
isreal: false
- id: {{ b64enc "e2e-service-provider" }}.1
name: e2e-service-provider
type: Tomcat
isreal: true
- id: {{ b64enc "php" }}.1
name: php
type: http
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "php" }}.1
sourcecomponents: []
target: {{ b64enc "e2e-service-provider" }}.1
targetcomponents: []
id: {{ b64enc "php" }}.1-{{ b64enc "e2e-service-provider" }}.1
detectpoints:
- CLIENT
- SERVER
- source: {{ b64enc "User" }}.0
sourcecomponents: []
target: {{ b64enc "php" }}.1
targetcomponents: []
id: {{ b64enc "User" }}.0-{{ b64enc "php" }}.1
detectpoints:
- SERVER
{{- end }}
# Licensed to the 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.
# The 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.
nodes:
{{- contains .nodes }}
- id: {{ b64enc "e2e-service-provider"}}.1
name: e2e-service-provider
type: Tomcat
isreal: true
- id: {{ b64enc "localhost:-1" }}.0
name: localhost:-1
type: H2
isreal: false
- id: {{ b64enc "php" }}.1
name: php
type: http
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "php" }}.1
sourcecomponents: []
target: {{ b64enc "e2e-service-provider" }}.1
targetcomponents: []
id: {{ b64enc "php" }}.1-{{ b64enc "e2e-service-provider" }}.1
detectpoints:
- CLIENT
- SERVER
- source: {{ b64enc "e2e-service-provider" }}.1
sourcecomponents: []
target: {{ b64enc "localhost:-1"}}.0
targetcomponents: []
id: {{ b64enc "e2e-service-provider" }}.1-{{ b64enc "localhost:-1"}}.0
detectpoints:
- CLIENT
{{- end }}
# Licensed to the 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.
# The 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.
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 2 }}
{{- end }}
# Licensed to the 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.
# The 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.
{{- contains . }}
- id: {{ b64enc "php" }}.1_{{ b64enc "/php/info" }}
name: /php/info
{{- end}}
# Licensed to the 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.
# The 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.
{{- contains . }}
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "GET:/info" }}
name: GET:/info
{{- end}}
# 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. shadow
{{- contains .}}
- id: {{ notEmpty .id }}
name: {{ notEmpty .name }}
attributes:
{{- contains .attributes }}
- name: os_name
value: linux
- name: host_name
value: {{ notEmpty .value }}
- name: process_no
value: {{ notEmpty .value }}
- name: ipv4s
value: {{ notEmpty .value }}
{{- end}}
language: PHP
instanceuuid: {{ notEmpty .instanceuuid }}
{{- end}}
# 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.
{{- contains . }}
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
name: provider1
attributes:
{{- contains .attributes }}
- name: OS Name
value: Linux
- name: hostname
value: {{ notEmpty .value }}
- name: Process No.
value: "1"
- name: Start Time
value: {{ notEmpty .value }}
- name: JVM Arguments
value: '{{ notEmpty .value }}'
- name: Jar Dependencies
value: '{{ notEmpty .value }}'
- name: ipv4s
value: {{ notEmpty .value }}
{{- end}}
language: JAVA
instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
{{- end}}
\ No newline at end of file
# Licensed to the 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.
# The 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.
{{- contains . }}
- id: {{ b64enc "e2e-service-provider" }}.1
name: e2e-service-provider
group: ""
- id: {{ b64enc "php" }}.1
name: php
group: ""
{{- end }}
# Licensed to the 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.
# The 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.
spans:
{{- contains .spans }}
- traceid: {{ .traceid }}
segmentid: {{ .segmentid }}
spanid: {{ .spanid }}
parentspanid: {{ .parentspanid }}
refs: []
servicecode: php
serviceinstancename: {{ notEmpty .serviceinstancename }}
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
endpointname: /php/info
type: Entry
peer: {{ notEmpty .peer }}
component: http
iserror: false
layer: Http
tags:
{{- contains .tags }}
- key: url
value: {{ notEmpty .value }}
{{- end }}
logs: []
- traceid: {{ notEmpty .traceid }}
segmentid: {{ .segmentid }}
spanid: {{ .spanid }}
parentspanid: {{ .parentspanid }}
refs: []
servicecode: php
serviceinstancename: {{ notEmpty .serviceinstancename }}
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
endpointname: /info
type: Exit
peer: provider:9090
component: HttpClient
iserror: false
layer: Http
tags:
{{- contains .tags }}
- key: url
value: {{ notEmpty .value }}
{{- end }}
logs: []
- traceid: {{ notEmpty .traceid }}
segmentid: {{ .segmentid }}
spanid: {{ .spanid }}
parentspanid: {{ .parentspanid }}
refs:
{{- contains .refs }}
- traceid: {{ notEmpty .traceid }}
parentsegmentid: {{ .parentsegmentid }}
parentspanid: 1
type: CROSS_PROCESS
{{- end }}
servicecode: e2e-service-provider
serviceinstancename: provider1
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
endpointname: GET:/info
type: Entry
peer: ""
component: Tomcat
iserror: false
layer: Http
tags:
{{- contains .tags }}
- key: http.method
value: GET
- key: url
value: {{ notEmpty .value }}
{{- end }}
logs: []
{{- end }}
# Licensed to the 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.
# The 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.
traces:
{{- contains .traces }}
- segmentid: {{ notEmpty .segmentid }}
endpointnames:
- /php/info
duration: {{ ge .duration 0 }}
start: "{{ notEmpty .start}}"
iserror: false
traceids:
- {{ (index .traceids 0) }}
{{- end }}
total: {{ gt .total 0 }}
# Licensed to the 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.
# The 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.
traces:
{{- contains .traces }}
- segmentid: {{ notEmpty .segmentid }}
endpointnames:
- GET:/info
duration: {{ ge .duration 0 }}
start: "{{ notEmpty .start}}"
iserror: false
traceids:
- {{ (index .traceids 0) }}
{{- end }}
total: {{ gt .total 0 }}
<?php
# Licensed to the 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.
# The 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.
usleep(500000);
$uri = $_SERVER['REQUEST_URI'];
if($uri == '/php/info') {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://provider:9090/info");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
}
; Licensed to the 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.
; The 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.
[skywalking]
extension=skywalking.so
skywalking.app_code = php
skywalking.enable = 1
skywalking.version = 8
skywalking.sock_path = /tmp/sky-agent.sock
......@@ -24,6 +24,8 @@ import org.apache.skywalking.e2e.User;
import org.apache.skywalking.e2e.UserRepo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.slf4j.LoggerFactory;
......@@ -39,7 +41,7 @@ public class UserController {
private final int sleepMin = 500;
private final int sleepMax = 1000;
@PostMapping("/info")
@RequestMapping(value = "/info", method = {RequestMethod.POST, RequestMethod.GET})
public String info() throws InterruptedException {
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
LOGBACK_LOGGER.info("logback message==> now: {}", System.currentTimeMillis());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册