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/05/10 13:02:11 UTC

[GitHub] [skywalking-rocketbot-ui] Fine0830 commented on a change in pull request #488: Add a function which show the statistics infomation during the trace query

Fine0830 commented on a change in pull request #488:
URL: https://github.com/apache/skywalking-rocketbot-ui/pull/488#discussion_r629325146



##########
File path: src/views/components/common/trace-detail-statistics-table.vue
##########
@@ -0,0 +1,326 @@
+<!-- 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. -->
+<template>
+  <div class="trace-detail-chart-table">
+    <div class="rk-trace-t-loading" v-show="loading">
+      <svg class="icon loading">
+        <use xlink:href="#spinner"></use>
+      </svg>
+    </div>
+    <TraceContainer :tableData="tableData" :type="HeaderType">
+      <div class="trace-tips" v-if="!tableData.length">{{ $t('noData') }}</div>
+    </TraceContainer>
+  </div>
+</template>
+<style lang="scss">
+  .rk-tooltip-popper.trace-table-tooltip .rk-tooltip-inner {
+    max-width: 600px;
+  }
+  .trace-detail-chart-table {
+    position: relative;
+    min-height: 300px;
+    border-bottom: 1px solid #ccc;
+  }
+</style>
+
+<script lang="js">

Review comment:
       Please use `ts`

##########
File path: src/views/components/common/index.ts
##########
@@ -16,6 +16,7 @@
  */
 
 import TraceDetailChartTable from './trace-detail-chart-table.vue';
+import TraceDetailStatisticsTable from './trace-detail-statistics-table.vue';
 import ConditionTags from './condition-tags.vue';
 
-export { TraceDetailChartTable, ConditionTags };
+export { TraceDetailChartTable, ConditionTags, TraceDetailStatisticsTable };

Review comment:
       `TraceDetailChartTable` and `TraceDetailStatisticsTable` seem to look the same. `TraceDetailStatisticsTable` was copied from `TraceDetailChartTable`?

##########
File path: src/views/components/common/trace-statistics-table/trace-item.vue
##########
@@ -0,0 +1,84 @@
+<!-- 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. -->
+
+<template>
+  <div>
+    <div :class="['trace-item']" ref="traceItem">
+      <div :class="['method']" :style="{ 'text-indent': 10 + 'px', width: `${method}px` }">
+        <span v-tooltip:bottom="{ content: data.endpointName, popperCls: ['trace-table-tooltip'] }">
+          {{ data.endpointName }}
+        </span>
+      </div>
+
+      <div class="max-time">
+        {{ data.maxTime }}
+      </div>
+      <div class="avg-time">
+        {{ parseInt(data.avgTime) }}
+      </div>
+      <div class="min-time">
+        {{ data.minTime }}
+      </div>
+      <div class="count">
+        {{ data.count }}
+      </div>
+      <div class="sum-time">
+        {{ data.sumTime }}
+      </div>
+    </div>
+  </div>
+</template>
+<script lang="js">
+  export default {

Review comment:
       As above. Please reuse existing components.

##########
File path: src/views/components/common/trace-statistics-table/trace-constant.ts
##########
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+export const ProfileConstant = [

Review comment:
       Could you please update the variable name about trace?

##########
File path: src/views/components/common/trace-statistics-table/trace-container.vue
##########
@@ -0,0 +1,76 @@
+<!-- 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. -->
+
+<template>
+  <div class="trace">
+    <div class="trace-header">
+      <div :class="item.label" v-for="(item, index) in data" :key="index">
+        {{ item.value }}
+      </div>
+    </div>
+    <Item :method="method" v-for="(item, index) in tableData" :data="item" :key="'key' + index" />
+    <slot></slot>
+  </div>
+</template>
+<script lang="js">

Review comment:
       This component is same as `trace-chart-table/trace-container `. Please reuse existing components rather than creating a same components.




-- 
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