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 2020/02/09 11:09:17 UTC

[GitHub] [skywalking-client-js] Fine0830 opened a new pull request #6: Feat: add performance data

Fine0830 opened a new pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6
 
 
   Trace performance data
   reference https://github.com/apache/skywalking/issues/4334
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] Fine0830 commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r376847351
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   I don't understand your question. The register of perf is `tracePerfDetail`. It doesn't seem to have the problem.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on issue #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#issuecomment-612833310
 
 
   @arugal Please recheck the backend protocol too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on issue #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#issuecomment-612829014
 
 
   > Does the PR support cache the performance data until the service and version register completed? If so, could you point out?
   
   Don't need the register anymore. Please take a look at the latest protocol, if you have anything to update, please let me know.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] Fine0830 commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r378150699
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   I update the PR, and I think we need service names to show in analysis UI.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r376883708
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   I set the question for a wrong line, sorry. I mean for `#sendByXhr`. According to the protocol, https://github.com/apache/skywalking-data-collect-protocol/blob/master/browser/BrowserPerf.proto#L39-L41, the report data should include service id and version id. But I can't see the check and buffer(if not registered yet).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r376781667
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   What happens if the register hasn't completed?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r376933920
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   No, those two parameters are required, that is why I asked. 
   1. Version could be set as `-` by default, if the client-js doesn't set it, but this must notify the backend implementation.
   1. Service Name is not existing in the protocol, only service ID, which means you have registered successfully. Do you want to add a name to the protocol as an alternative way?
   
   My point is, this register would take time, you should have a buffer to hold this value until the register is done. Unless you should add name and version strings into the protocol. Also, you should know, the ID is required in the distributed tracing too. Even you add name and version in this protocol, you can't add those in the tracing protocol, the buffer mechanism is still required.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] wu-sheng commented on issue #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#issuecomment-585742399
 
 
   Does the PR support cache the performance data until the service and version register completed? If so, could you point out?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking-client-js] Fine0830 commented on a change in pull request #6: Feat: add performance data

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on a change in pull request #6: Feat: add performance data
URL: https://github.com/apache/skywalking-client-js/pull/6#discussion_r376930892
 
 

 ##########
 File path: src/performance/index.ts
 ##########
 @@ -0,0 +1,55 @@
+
+/**
+ * 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.
+ */
+
+import { CustomPerfOptionsType } from '../types';
+import Report from '../services/report';
+import pagePerf from './perf';
+
+class TracePerf {
+  private isPerf: boolean = true;
+  private perfConfig = {
+    resources: [],
+    perfDetail: {},
+  } as any;
+
+  public recordPerf(options: CustomPerfOptionsType) {
+    if (this.isPerf) {
+      this.perfConfig.performance = pagePerf.getPerfTiming();
+    }
+    const perfInfo = {
+      perfDetail: this.perfConfig.perfDetail,
+      resources: this.perfConfig.resources,
+      ...options,
+    };
+    new Report(options.reportUrl).sendByXhr(perfInfo);
+    this.clearPerf();
 
 Review comment:
   Oooh,  are these two parameters optional? If we don't pass ids, server seems to get data from service name and version id is current version. I forgot where it was explained. BTW, if we analysis data with time dimension, version doesn't seem to be need.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services