profiling-dashboard.vue 44.5 KB
Newer Older
P
ph 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<!--
Copyright 2020 Huawei Technologies Co., Ltd.All Rights Reserved.

Licensed 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="pro-router-wrap">
    <div class="pro-router-left">
      <div class="step-trace">
        <div class="title-wrap">
          <div class="title">{{ $t('profiling.stepTrace') }}</div>
          <div class="view-detail">
            <button @click="viewDetail('step-trace')"
                    :disabled="svg.noData && svg.data.length === 0"
                    :class="{disabled:svg.noData && svg.data.length === 0}">{{ $t('profiling.viewDetail') }}
              <i class="el-icon-d-arrow-right"></i></button>
          </div>
P
ph 已提交
28 29
          <div class="tip-icon">
            <el-tooltip placement="bottom"
P
ph 已提交
30
                        effect="light">
P
ph 已提交
31 32
              <div slot="content"
                   class="tooltip-container">
33
                <div class="font-size-style">{{$t("profiling.features")}}</div>
P
ph 已提交
34 35
                <div>{{$t('profiling.iterationInfo')}}</div>
                <div>
36
                  <span class="font-style">{{$t('profiling.queueInfo')}}&nbsp;</span>
P
ph 已提交
37 38 39
                  <span>{{$t('profiling.iterationGapInfo')}}</span>
                </div>
                <div>
40
                  <span class="font-style">{{$t('profiling.fpbpTitle')}}&nbsp;</span>
P
ph 已提交
41 42 43
                  <span>{{$t('profiling.fpbpInfo')}}</span>
                </div>
                <div>
44
                  <span class="font-style">{{$t('profiling.iterativeTailingTitle')}}&nbsp;</span>
P
ph 已提交
45 46 47
                  <span>{{$t('profiling.iterativeTailingInfo')}}</span>
                </div>
                <br />
48
                <div class="font-size-style">{{$t('profiling.statistics')}}</div>
P
ph 已提交
49 50 51
                <div>{{$t('profiling.totalTime')}}
                  <span>{{totalTime}}{{$t('profiling.millisecond')}}</span>
                </div>
P
ph 已提交
52
                <div>{{$t('profiling.totalSteps')}}<span>{{totalSteps}}</span></div>
53 54 55
                <div>{{$t('profiling.iterationGapTimeRatio')}}<span>{{iteration_interval_percent}}</span></div>
                <div>{{$t('profiling.fpbpTimeRatio')}}<span>{{fp_and_bp_percent}}</span></div>
                <div>{{$t('profiling.iterativeTailingTimeRatio')}}<span>{{tail_percent}}</span></div>
P
ph 已提交
56
              </div>
P
ph 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
              <i class="el-icon-info"></i>
            </el-tooltip>
          </div>
        </div>
        <div class="trace-container">
          <div id="trace"
               class="training-trace">
            <svg version="1.1"
                 xmlns="http://www.w3.org/2000/svg"
                 height="100%"
                 width="100%">
              <defs>
                <marker id="marker_end"
                        refX="5"
                        refY="4"
                        markerWidth="10"
                        markerHeight="8"
                        orient="auto">
                  <path d="M1,1 L1,7 L9,4 z"
76 77
                        fill="#6c7280"
                        stroke="#6c7280"></path>
P
ph 已提交
78 79 80 81 82 83 84 85
                </marker>
                <marker id="marker_start"
                        refX="5"
                        refY="4"
                        markerWidth="10"
                        markerHeight="8"
                        orient="auto">
                  <path d="M9,1 L9,7 L1,4 z"
86 87
                        fill="#6c7280"
                        stroke="#6c7280"></path>
P
ph 已提交
88 89 90 91 92
                </marker>
              </defs>
            </svg>
          </div>
          <div class="image-noData"
F
fengxuefeng 已提交
93
               v-if="svg.noData && svg.initOver">
P
ph 已提交
94 95 96 97 98 99 100 101 102 103 104
            <div>
              <img :src="require('@/assets/images/nodata.png')"
                   alt="" />
            </div>
            <p>{{$t("public.noData")}}</p>
          </div>
        </div>
      </div>
      <div class="minddata">
        <div class="title-wrap">
          <div class="title">{{ $t('profiling.mindData') }}</div>
P
ph 已提交
105
          <div class="view-detail">
P
ph 已提交
106
            <button @click="viewDetail('data-process')"
P
ph 已提交
107 108 109
                    :disabled="processSummary.noData"
                    :class="{disabled:processSummary.noData}">
              {{ $t('profiling.viewDetail') }}
P
ph 已提交
110 111
              <i class="el-icon-d-arrow-right"></i></button>
          </div>
P
ph 已提交
112 113 114 115 116
          <div class="tip-icon">
            <el-tooltip placement="bottom"
                        effect="light">
              <div slot="content"
                   class="tooltip-container">
117
                <div class="font-size-style">{{$t("profiling.features")}}</div>
P
ph 已提交
118 119 120 121
                <div>{{$t('profiling.dataProcess')}}</div>
                <div>{{$t('profiling.dataProcessInfo')}}</div>
                <div>{{$t('profiling.analysisOne')}}</div>
                <div>{{$t('profiling.analysisTwo')}}</div>
P
ph 已提交
122
                <div v-show="deviceInfoShow || queueInfoShow">{{$t('profiling.higherAnalysis')}}</div>
P
ph 已提交
123
                <br />
124 125
                <div v-show="deviceInfoShow || queueInfoShow"
                     class="font-size-style">{{$t('profiling.statistics')}}</div>
P
ph 已提交
126
                <div v-show="queueInfoShow">{{$t('profiling.chipInfo')}}
P
ph 已提交
127
                  <span>{{queueInfoEmptyNum}} / {{queueInfoTotalNum}}</span>
P
ph 已提交
128 129 130
                </div>
                <div v-show="deviceInfoShow">
                  <div>{{$t('profiling.hostIsEmpty')}}
P
ph 已提交
131
                    <span>{{deviceInfoEmptyNum}} / {{deviceInfoTotalNum}}</span>
P
ph 已提交
132 133
                  </div>
                  <div>{{$t('profiling.hostIsFull')}}
P
ph 已提交
134
                    <span>{{deviceInfoFullNum}} / {{deviceInfoTotalNum}}</span>
P
ph 已提交
135 136 137 138 139 140
                  </div>
                </div>
              </div>
              <i class="el-icon-info"></i>
            </el-tooltip>
          </div>
P
ph 已提交
141
        </div>
P
ph 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
        <div class="pipeline-container"
             v-show="!processSummary.noData">
          <div class="cell-container data-process">
            <div class="title">
              {{$t('profiling.pipeline')}}
            </div>
          </div>

          <div class="queue-container">
            <div class="img">
              <div class="edge">
                <img src="@/assets/images/data-flow.png"
                     alt="" />
              </div>
              <div class="icon">
                <img src="@/assets/images/queue.svg"
                     alt=""
                     clickKey="connector_queue" />
              </div>
              <div class="edge">
                <img src="@/assets/images/data-flow.png"
                     alt="" />
              </div>
            </div>
            <div class="title">{{$t('profiling.connectorQuene')}}</div>
            <div class="description">
P
ph 已提交
168
              <div class="line"></div>
P
ph 已提交
169 170 171 172
              <div class="item"
                   v-if="processSummary.device.empty || processSummary.device.empty === 0">
                {{$t('profiling.queueTip2')}}
                <span class="num">
P
ph 已提交
173
                  {{processSummary.device.empty}} / {{processSummary.device.total}}
P
ph 已提交
174 175 176 177 178 179
                </span>
              </div>
              <div class="item"
                   v-if="processSummary.device.full || processSummary.device.full === 0">
                {{$t('profiling.queueTip1')}}
                <span class="num">
180
                  {{processSummary.device.full}} / {{processSummary.device.total}}
P
ph 已提交
181 182 183
                </span>
              </div>
            </div>
P
ph 已提交
184
          </div>
P
ph 已提交
185 186 187 188

          <div class="cell-container device_queue_op"
               clickKey="device_queue_op">
            <div class="title">
189
              {{$t('profiling.deviceQueueOp')}}
P
ph 已提交
190 191 192 193
            </div>
          </div>

          <div class="queue-container"
194
               v-if="processSummary.count === processSummary.maxCount">
P
ph 已提交
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
            <div class="img">
              <div class="edge">
                <img src="@/assets/images/data-flow.png"
                     alt="" />
              </div>
              <div class="icon">
                <img src="@/assets/images/queue.svg"
                     clickKey="data_queue"
                     alt="" />
              </div>
              <div class="edge">
                <img src="@/assets/images/data-flow.png"
                     alt="" />
              </div>
            </div>
            <div class="title">{{$t('profiling.dataQueue')}}</div>
            <div class="description">
P
ph 已提交
212
              <div class="line"></div>
P
ph 已提交
213 214 215 216
              <div class="item"
                   v-if="processSummary.get_next.empty || processSummary.get_next.empty === 0">
                {{$t('profiling.queueTip2')}}
                <span class="num">
P
ph 已提交
217
                  {{processSummary.get_next.empty}} / {{processSummary.get_next.total}}
P
ph 已提交
218 219 220 221 222 223
                </span>
              </div>
              <div class="item"
                   v-if="processSummary.get_next.full || processSummary.get_next.full === 0">
                {{$t('profiling.queueTip1')}}
                <span class="num">
224
                  {{processSummary.get_next.full}} / {{processSummary.get_next.total}}
P
ph 已提交
225 226 227 228 229 230 231
                </span>
              </div>
            </div>
          </div>

          <div class="cell-container get-next"
               clickKey="get_next"
232
               v-if="processSummary.count === processSummary.maxCount">
P
ph 已提交
233 234 235 236 237 238
            <div class="title">
              {{$t('profiling.getData')}}
            </div>
          </div>
        </div>
        <div class="image-noData"
F
fengxuefeng 已提交
239
             v-if="processSummary.noData && processSummary.initOver">
P
ph 已提交
240 241 242 243 244
          <div>
            <img :src="require('@/assets/images/nodata.png')"
                 alt="" />
          </div>
          <p>{{$t("public.noData")}}</p>
P
ph 已提交
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
        </div>
      </div>
    </div>
    <div class="pro-router-right">
      <div class="op-time-consume">
        <div class="title-wrap">
          <div class="title">{{ $t('profiling.rankOfOperator') }}</div>
          <div class="view-detail">
            <button @click="viewDetail('operator')"
                    :disabled="pieChart.noData && pieChart.data.length === 0"
                    :class="{disabled:pieChart.noData && pieChart.data.length === 0}">{{ $t('profiling.viewDetail') }}
              <i class="el-icon-d-arrow-right"></i></button>
          </div>
        </div>
        <div class="image-noData"
F
fengxuefeng 已提交
260
             v-if="pieChart.noData && pieChart.data.length === 0 && pieChart.initOver">
P
ph 已提交
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
          <div>
            <img :src="require('@/assets/images/nodata.png')"
                 alt="" />
          </div>
          <p>{{$t("public.noData")}}</p>
        </div>
        <div class="op-time-content">
          <div id="pieChart"
               class="pie-chart"
               v-if="pieChart.data.length"></div>
          <div class="time-list"
               v-if="pieChart.data.length">
            <ul>
              <li v-for="(item, index) in pieChart.topN"
                  :key="index"
                  class="item">
                <span class="index"
                      :style="{'background-color': pieChart.colorList[index]}">{{index + 1}}</span>
                <span class="name">{{item.name}}</span>
                <span class="num">{{item.frequency + $t('profiling.times')}}</span>
                <span class="time">
                  <span class="bar"
                        :style="{width: item.time / pieChart.topN[0].time * 100 + '%'}"></span>
284
                  <span class="value">{{item.time + $t('profiling.unit')}}</span>
P
ph 已提交
285 286 287 288 289 290 291 292 293
                </span>
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="time-line">
        <div class="title-wrap">
          <div class="title">{{ $t('profiling.timeLine') }}</div>
P
ph 已提交
294
          <div class="view-detail">
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
            <button @click="downloadPerfetto()"
                    :disabled="timeLine.waiting"
                    :class="{disabled:timeLine.waiting}">{{ $t('profiling.downloadTimeline') }}
            </button>
          </div>
          <div class="tip-icon">
            <el-tooltip placement="bottom"
                        effect="light">
              <div slot="content"
                   class="tooltip-container">
                <div class="font-size-style">{{$t("profiling.features")}}</div>
                <div class="font-style">{{$t("profiling.timelineTips.title1")}}</div>
                <div>{{$t("profiling.timelineTips.content11")}}</div>
                <div>{{$t("profiling.timelineTips.content12")}}</div>
                <div>{{$t("profiling.timelineTips.content13")}}</div>
                <br>
                <div class="font-style">{{$t("profiling.timelineTips.title2")}}</div>
                <div>{{$t("profiling.timelineTips.content21")}}</div>
                <div>{{$t("profiling.timelineTips.content22")}}</div>
                <div>{{$t("profiling.timelineTips.content23")}}</div>
                <br>
                <div class="font-style">{{$t("profiling.timelineTips.title3")}}</div>
                <div>{{$t("profiling.timelineTips.content31")}}</div>
                <div>{{$t("profiling.timelineTips.content32")}}</div>
              </div>
              <i class="el-icon-info"></i>
            </el-tooltip>
P
ph 已提交
322 323
          </div>
        </div>
P
ph 已提交
324 325 326 327 328 329 330 331 332 333 334 335
        <div class="timeline-info"
             v-if="!timelineInfo.noData">
          <div class="info-line">
            <span>{{$t('profiling.opTotalTime')}}</span><span>{{timelineInfo.totalTime}}ms</span>
          </div>
          <div class="info-line">
            <span>{{$t('profiling.streamNum')}}</span><span>{{timelineInfo.streamNum}}</span>
          </div>
          <div class="info-line">
            <span>{{$t('profiling.opNum')}}</span><span>{{timelineInfo.opNum}}</span></div>
          <div class="info-line">
            <span>{{$t('profiling.opTimes')}}</span><span>{{timelineInfo.opTimes + $t('profiling.times')}}</span>
P
ph 已提交
336
          </div>
P
ph 已提交
337 338 339

        </div>
        <div class="image-noData"
F
fengxuefeng 已提交
340
             v-if="timelineInfo.noData && timelineInfo.initOver">
P
ph 已提交
341 342 343 344 345
          <div>
            <img :src="require('@/assets/images/nodata.png')"
                 alt="" />
          </div>
          <p>{{$t("public.noData")}}</p>
P
ph 已提交
346 347 348 349 350 351 352 353 354 355 356 357
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import echarts from 'echarts';
import RequestService from '../../services/request-service';
import CommonProperty from '../../common/common-property';
export default {
  data() {
    return {
358 359
      fp_and_bp_percent: '--',
      iteration_interval_percent: '--',
P
ph 已提交
360 361
      totalSteps: '--',
      totalTime: '--',
362
      tail_percent: '--',
P
ph 已提交
363 364 365 366 367 368 369
      queueInfoShow: false,
      deviceInfoShow: false,
      queueInfoEmptyNum: '--',
      queueInfoTotalNum: '--',
      deviceInfoEmptyNum: '--',
      deviceInfoTotalNum: '--',
      deviceInfoFullNum: '--',
P
ph 已提交
370 371 372 373 374
      svg: {
        data: [],
        svgPadding: 20,
        totalWidth: 0,
        totalTime: 0,
375 376 377 378 379
        cellHeight: 40,
        cellPadding: 0,
        rowPadding: 20,
        rowMargin: 10,
        totalHeight: 0,
P
ph 已提交
380
        markerPadding: 4,
381 382 383 384 385
        minRate: 0.1,
        minTime: 0,
        minWidth: 1,
        fontSize: 12,
        textMargin: 21,
P
ph 已提交
386 387
        namespaceURI: 'http://www.w3.org/2000/svg',
        resizeTimer: null,
388 389 390 391 392 393
        colors: {
          iteration_interval: ['#A6DD82', '#edf8e6'],
          fp_and_bp: ['#6CBFFF', '#e2f2ff'],
          tail: ['#fa8e5b', '#fff4de'],
          stream_parallel: ['#01a5a7', '#cceded'],
        },
P
ph 已提交
394
        noData: false,
F
fengxuefeng 已提交
395
        initOver: false,
P
ph 已提交
396 397 398 399 400 401 402 403 404 405 406
      },
      trainingJobId: this.$route.query.id,
      summaryPath: this.$route.query.dir,
      relativePath: this.$route.query.path,
      currentCard: '',
      pieChart: {
        chartDom: null,
        data: [],
        noData: false,
        topN: [],
        colorList: ['#6C92FA', '#6CBFFF', '#4EDED2', '#7ADFA0', '#A6DD82'],
F
fengxuefeng 已提交
407
        initOver: false,
P
ph 已提交
408
      },
409
      timeLine: {
P
ph 已提交
410 411 412 413 414 415 416 417 418
        data: null,
        waiting: true,
      },
      timelineInfo: {
        totalTime: 0,
        streamNum: 0,
        opNum: 0,
        opTimes: 0,
        noData: true,
F
fengxuefeng 已提交
419
        initOver: false,
P
ph 已提交
420 421 422 423
      },
      processSummary: {
        noData: true,
        count: 6,
424
        maxCount: 6,
P
ph 已提交
425 426 427 428 429 430 431 432 433 434
        device: {
          empty: 0,
          full: 0,
          total: 0,
        },
        get_next: {
          empty: 0,
          full: 0,
          total: 0,
        },
F
fengxuefeng 已提交
435
        initOver: false,
P
ph 已提交
436
      },
P
ph 已提交
437 438
    };
  },
439 440 441 442 443
  mounted() {
    setTimeout(() => {
      this.$bus.$on('collapse', this.resizeTrace);
    }, 500);
  },
P
ph 已提交
444 445 446
  watch: {
    '$parent.curDashboardInfo': {
      handler(newValue, oldValue) {
447 448 449 450
        if (newValue.curCardNum === '') {
          this.pieChart.noData = true;
          this.svg.noData = true;
        }
P
ph 已提交
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
        if (newValue.query.dir && newValue.query.id && newValue.query.path) {
          this.summaryPath = newValue.query.dir;
          this.trainingJobId = newValue.query.id;
          this.relativePath = newValue.query.path;
          this.currentCard = newValue.curCardNum;
          if (this.trainingJobId) {
            document.title = `${decodeURIComponent(
                this.trainingJobId,
            )}-${this.$t('profiling.profilingDashboard')}
        -MindInsight`;
          } else {
            document.title = `${this.$t(
                'profiling.profilingDashboard',
            )}-MindInsight`;
          }
          this.init();
        }
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    init() {
P
ph 已提交
475
      this.queryTimeline();
P
ph 已提交
476
      this.queryTrainingTrace();
P
ph 已提交
477
      this.getProccessSummary();
P
ph 已提交
478 479 480
      this.initPieChart();
      window.addEventListener('resize', this.resizeTrace, false);
    },
P
ph 已提交
481 482 483 484 485 486 487
    getProccessSummary() {
      const params = {
        train_id: this.trainingJobId,
        profile: this.summaryPath,
        device_id: this.currentCard,
      };
      RequestService.queryProcessSummary(params).then((resp) => {
F
fengxuefeng 已提交
488
        this.processSummary.initOver = true;
P
ph 已提交
489 490 491 492
        if (resp && resp.data) {
          const data = JSON.parse(JSON.stringify(resp.data));
          this.processSummary.count = Object.keys(data).length;
          this.dealProcess(data);
P
ph 已提交
493
          // Chip side
P
ph 已提交
494 495 496 497 498 499 500
          if (resp.data.get_next_queue_info) {
            this.queueInfoShow = true;
            this.queueInfoEmptyNum =
              resp.data.get_next_queue_info.summary.empty_batch_count;
            this.queueInfoTotalNum =
              resp.data.get_next_queue_info.summary.total_batch;
          }
P
ph 已提交
501
          // Host side
P
ph 已提交
502 503 504 505 506 507 508 509 510 511 512
          if (resp.data.device_queue_info) {
            this.deviceInfoShow = true;
            this.deviceInfoEmptyNum =
              resp.data.device_queue_info.summary.empty_batch_count;
            this.deviceInfoTotalNum =
              resp.data.device_queue_info.summary.total_batch;
            this.deviceInfoFullNum =
              resp.data.device_queue_info.summary.full_batch_count;
          }
        } else {
          this.dealProcess(null);
F
fengxuefeng 已提交
513
          this.processSummary.initOver = true;
P
ph 已提交
514 515 516
        }
      });
    },
P
ph 已提交
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
    viewDetail(path) {
      this.$router.push({
        path,
        query: {
          id: this.trainingJobId,
          dir: this.summaryPath,
          path: this.relativePath,
        },
      });
    },
    setPieOption() {
      const option = {};
      option.tooltip = {
        trigger: 'item',
        formatter: (params) => {
P
ph 已提交
532
          return `${params.data.name}<br>${params.marker}${params.percent}%`;
P
ph 已提交
533
        },
P
ph 已提交
534 535
        confine: true,
        extraCssText: 'white-space:normal; word-break:break-word;',
P
ph 已提交
536 537 538 539
      };
      option.series = [
        {
          type: 'pie',
P
ph 已提交
540
          center: ['50%', '50%'],
P
ph 已提交
541
          data: this.pieChart.data,
P
ph 已提交
542 543 544 545 546 547
          radius: '80%',
          label: {
            normal: {
              show: false,
              positionL: 'inner',
            },
P
ph 已提交
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
          },
          itemStyle: {
            normal: {
              color: function(params) {
                return CommonProperty.pieColorArr[params.dataIndex];
              },
            },
          },
        },
      ];
      this.$nextTick(() => {
        const dom = document.getElementById('pieChart');
        if (dom) {
          this.pieChart.chartDom = echarts.init(dom, null);
        } else {
          if (this.pieChart.chartDom) {
            this.pieChart.chartDom.clear();
          }
          return;
        }
        this.pieChart.chartDom.setOption(option, true);
        this.pieChart.chartDom.resize();
      }, 10);
    },
    initPieChart() {
      const params = {};
      params.params = {
        profile: this.summaryPath,
        train_id: this.trainingJobId,
      };
      params.body = {
        op_type: 'aicore_type',
        device_id: this.currentCard,
        filter_condition: {},
        sort_condition: {
          name: 'execution_time',
          type: 'descending',
        },
      };
      RequestService.getProfilerOpData(params)
          .then((res) => {
F
fengxuefeng 已提交
589
            this.pieChart.initOver = true;
P
ph 已提交
590 591 592 593
            if (res && res.data) {
              if (res.data.object) {
                this.pieChart.data = [];
                res.data.object.forEach((item) => {
P
ph 已提交
594
                  if (this.pieChart.data && this.pieChart.data.length < 5) {
P
ph 已提交
595 596 597 598 599 600 601
                    this.pieChart.data.push({
                      name: item[0],
                      value: item[1],
                      frequency: item[2],
                      percent: item[3],
                    });
                  } else {
P
ph 已提交
602 603
                    if (!this.pieChart.data[5]) {
                      this.pieChart.data[5] = {
P
ph 已提交
604 605 606 607 608
                        name: 'Other',
                        value: 0,
                        percent: 0,
                      };
                    }
P
ph 已提交
609 610
                    this.pieChart.data[5].value += item[1];
                    this.pieChart.data[5].percent += item[3];
P
ph 已提交
611 612 613 614 615 616 617 618 619 620 621
                  }
                });
                this.setPieOption();
                if (this.pieChart.data.length === 0) {
                  this.pieChart.noData = true;
                }
                this.pieChart.topN = this.pieChart.data
                    .slice(0, Math.min(this.pieChart.data.length, 5))
                    .map((i) => {
                      return {
                        name: i.name,
622
                        time: i.value,
P
ph 已提交
623 624 625 626 627 628 629 630
                        frequency: i.frequency,
                      };
                    });
              }
            }
          })
          .catch(() => {
            this.pieChart.noData = true;
F
fengxuefeng 已提交
631
            this.pieChart.initOver = true;
P
ph 已提交
632 633 634 635 636 637 638 639 640 641
          });
    },
    queryTrainingTrace() {
      const params = {
        dir: this.relativePath,
        type: 0,
        device_id: this.currentCard,
      };
      RequestService.queryTrainingTrace(params).then(
          (res) => {
F
fengxuefeng 已提交
642
            this.svg.initOver = true;
P
ph 已提交
643 644 645 646 647 648 649
            if (
              res.data &&
            res.data.training_trace_graph &&
            res.data.training_trace_graph.length
            ) {
              this.svg.noData = false;
              this.removeTrace();
650 651 652 653 654 655
              this.$nextTick(() => {
                this.packageTraceData(
                    JSON.parse(JSON.stringify(res.data.training_trace_graph)),
                );
              });

P
ph 已提交
656
              if (res.data.summary) {
657 658 659
                this.fp_and_bp_percent = res.data.summary.fp_and_bp_percent;
                this.iteration_interval_percent =
                res.data.summary.iteration_interval_percent;
P
ph 已提交
660 661
                this.totalSteps = res.data.summary.total_steps;
                this.totalTime = res.data.summary.total_time;
662
                this.tail_percent = res.data.summary.tail_percent;
P
ph 已提交
663
              } else {
664 665
                this.fp_and_bp_percent = '--';
                this.iteration_interval_percent = '--';
P
ph 已提交
666 667
                this.totalSteps = '--';
                this.totalTime = '--';
668
                this.tail_percent = '--';
P
ph 已提交
669
              }
P
ph 已提交
670 671 672 673 674 675 676 677 678 679 680
            } else {
              document.querySelector('#trace').style.height = '0px';
              this.svg.noData = true;
              this.svg.data = [];
              this.removeTrace();
            }
          },
          (error) => {
            document.querySelector('#trace').style.height = '0px';
            this.svg.noData = true;
            this.svg.data = [];
F
fengxuefeng 已提交
681
            this.svg.initOver = true;
P
ph 已提交
682 683 684 685 686
            this.removeTrace();
          },
      );
    },

687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744
    packageTraceData(traceGraph) {
      this.svg.totalTime = 0;
      this.svg.minTime = 0;
      this.svg.totalHeight = 0;
      const data = [];

      if (traceGraph && traceGraph[0] && traceGraph[0][0]) {
        this.svg.totalTime = traceGraph[0][0].duration;
        this.svg.minTime = this.svg.minRate * this.svg.totalTime;

        traceGraph.forEach((row, index) => {
          const rowObj = {
            rowCount: 0,
            data: [],
            height: 0,
            startY: this.svg.totalHeight,
          };
          let obj = [];
          for (let i = 0; i < row.length; i++) {
            if (row[i].duration < this.svg.minTime) {
              if (obj.length) {
                rowObj.data.push(obj);
                obj = [];
                rowObj.rowCount++;
              }
              rowObj.data.push([row[i]]);
              rowObj.rowCount++;
            } else {
              obj.push(row[i]);
            }

            if (i === row.length - 1 && obj.length) {
              rowObj.data.push(obj);
              obj = [];
              rowObj.rowCount++;
            }
          }
          rowObj.height =
            rowObj.rowCount * this.svg.cellHeight +
            (rowObj.rowCount - 1) * this.svg.cellPadding +
            (index ? this.svg.rowPadding * 2 : 0);

          this.svg.totalHeight += rowObj.height + this.svg.rowMargin;
          data.push(rowObj);
        });

        this.svg.totalHeight += this.svg.rowPadding;
        document.querySelector(
            '#trace',
        ).style.height = `${this.svg.totalHeight}px`;
        this.svg.data = JSON.parse(JSON.stringify(data));

        this.$nextTick(() => {
          this.dealTraceData();
        });
      }
    },

P
ph 已提交
745 746 747 748
    dealTraceData() {
      const traceDom = document.querySelector('#trace');
      if (traceDom) {
        this.svg.totalWidth = traceDom.offsetWidth - this.svg.svgPadding * 2;
749

750
        if (this.svg.data[0] && this.svg.data[0].data.length) {
751
          const svg = traceDom.querySelector('svg');
P
ph 已提交
752
          if (this.svg.totalTime) {
753 754 755 756 757 758
            this.svg.data.forEach((item, index) => {
              let itemDom = {};
              if (index) {
                itemDom = this.createMultipleRowContainer(item);
              } else {
                itemDom = this.createRowContainer(item.data, item.startY);
P
ph 已提交
759
              }
760
              svg.appendChild(itemDom);
P
ph 已提交
761 762 763 764 765 766 767
            });
          }
        } else {
          this.removeTrace();
        }
      }
    },
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792

    createMultipleRowContainer(item) {
      const rectContainer = document.createElementNS(
          this.svg.namespaceURI,
          'g',
      );
      rectContainer.setAttribute('class', 'container');

      const rect = document.createElementNS(this.svg.namespaceURI, 'rect');
      rect.setAttribute('x', this.svg.svgPadding);
      rect.setAttribute('y', item.startY + this.svg.rowPadding);
      rect.setAttribute('height', item.height);
      rect.setAttribute('width', this.svg.totalWidth);
      rect.setAttribute('style', 'fill:#edf0f5;stroke:#E2E2E2;stroke-width:1');
      rectContainer.appendChild(rect);

      const temp = this.createRowContainer(
          item.data,
          item.startY + this.svg.rowPadding,
      );
      rectContainer.appendChild(temp);
      return rectContainer;
    },

    createRowContainer(data, startY) {
P
ph 已提交
793
      const g = document.createElementNS(this.svg.namespaceURI, 'g');
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812

      data.forEach((row, index) => {
        const y =
          startY +
          this.svg.rowPadding +
          index * (this.svg.cellPadding + this.svg.cellHeight);
        row.forEach((i) => {
          if (i.duration) {
            let temp;
            if (i.name) {
              temp = this.createRect(i, y);
              g.insertBefore(temp, g.querySelector('g'));
            } else {
              temp = this.createArrow(i, y);
              g.appendChild(temp);
            }
          }
        });
      });
P
ph 已提交
813 814
      return g;
    },
815 816 817 818 819 820

    createRect(data, startY) {
      const color =
        data.name && this.svg.colors[data.name]
          ? this.svg.colors[data.name]
          : this.svg.colors.stream_parallel;
821

P
ph 已提交
822 823 824
      const x1 =
        (data.start / this.svg.totalTime) * this.svg.totalWidth +
        this.svg.svgPadding;
825

826 827 828 829 830
      const width = Math.max(
          this.svg.minWidth,
          (data.duration / this.svg.totalTime) * this.svg.totalWidth,
      );

831 832 833 834 835 836
      let name = '';
      switch (data.name) {
        case 'iteration_interval':
          name = this.$t('profiling.lterationGap');
          break;
        case 'fp_and_bp':
837
          name = this.$t('profiling.deviceQueueOpTip');
838 839 840 841 842 843 844 845
          break;
        case 'tail':
          name = this.$t('profiling.lterationTail');
          break;
        default:
          name = data.name;
          break;
      }
P
ph 已提交
846

847 848 849 850 851 852 853
      const textContent = `${name}: ${data.duration.toFixed(4)}ms`;
      const textWidth = this.getTextWidth(textContent);
      const normalSize = data.duration >= this.svg.minTime;

      const g = document.createElementNS(this.svg.namespaceURI, 'g');
      g.setAttribute('class', 'rect');

P
ph 已提交
854 855
      const rect = document.createElementNS(this.svg.namespaceURI, 'rect');
      rect.setAttribute('x', x1);
856 857
      rect.setAttribute('y', startY);
      rect.setAttribute('height', this.svg.cellHeight);
P
ph 已提交
858
      rect.setAttribute('width', width);
859
      rect.setAttribute('style', `fill:${color[1]};stroke:${color[0]};`);
P
ph 已提交
860 861 862 863 864

      const foreignObject = document.createElementNS(
          this.svg.namespaceURI,
          'foreignObject',
      );
865
      foreignObject.textContent = textContent;
866 867
      foreignObject.setAttribute(
          'x',
868
        normalSize
869 870
          ? x1
          : Math.min(
871 872 873 874 875
              this.svg.svgPadding * 2 +
                this.svg.totalWidth -
                textWidth -
                this.svg.textMargin,
              Math.max(this.svg.textMargin, x1 + width / 2 - textWidth / 2),
876 877 878
          ),
      );

879 880
      foreignObject.setAttribute('y', startY);
      foreignObject.setAttribute('height', this.svg.cellHeight);
P
ph 已提交
881
      foreignObject.setAttribute('width', width);
882
      foreignObject.setAttribute('style', `color:${color[0]}`);
P
ph 已提交
883
      foreignObject.setAttribute(
884
          'class',
885
          `content${normalSize ? '' : ' content-mini'}`,
P
ph 已提交
886 887 888
      );

      const title = document.createElementNS(this.svg.namespaceURI, 'title');
889
      title.textContent = textContent;
P
ph 已提交
890

891 892 893
      g.appendChild(rect);
      g.appendChild(foreignObject);
      g.appendChild(title);
P
ph 已提交
894 895 896
      return g;
    },

897
    createArrow(data, startY) {
P
ph 已提交
898 899 900 901
      const width = (data.duration / this.svg.totalTime) * this.svg.totalWidth;
      const x1 =
        (data.start / this.svg.totalTime) * this.svg.totalWidth +
        this.svg.svgPadding;
902 903
      const centerY = startY + this.svg.cellHeight / 2;

P
ph 已提交
904
      const g = document.createElementNS(this.svg.namespaceURI, 'g');
905
      g.setAttribute('class', 'arrow');
P
ph 已提交
906 907

      const line = document.createElementNS(this.svg.namespaceURI, 'line');
908 909 910 911 912 913 914 915 916 917 918 919
      line.setAttribute('y1', centerY);
      line.setAttribute('y2', centerY);
      line.setAttribute('style', 'stroke:#6c7280;stroke-width:1');
      if (width > this.svg.markerPadding) {
        line.setAttribute('x1', x1 + this.svg.markerPadding);
        line.setAttribute('x2', x1 + width - this.svg.markerPadding);
        line.setAttribute('marker-end', 'url(#marker_end)');
        line.setAttribute('marker-start', 'url(#marker_start)');
      } else {
        line.setAttribute('x1', x1);
        line.setAttribute('x2', x1 + width);
      }
P
ph 已提交
920 921

      const text = document.createElementNS(this.svg.namespaceURI, 'text');
P
ph 已提交
922
      text.textContent = `${
923 924 925
        data.duration === this.svg.totalTime
          ? this.$t('profiling.approximateTime')
          : ''
P
ph 已提交
926
      }${data.duration.toFixed(4)}ms`;
927 928 929
      const textWidth = text.textContent
        ? this.getTextWidth(text.textContent)
        : 0;
930 931 932
      text.setAttribute(
          'x',
          Math.min(
933 934 935 936 937
              this.svg.svgPadding * 2 +
            this.svg.totalWidth -
            textWidth -
            this.svg.textMargin,
              Math.max(this.svg.textMargin, width / 2 + x1 - textWidth / 2),
938 939
          ),
      );
940 941 942
      text.setAttribute('y', centerY - this.svg.fontSize / 2);
      text.setAttribute('font-size', this.svg.fontSize);
      text.setAttribute('fill', 'black');
P
ph 已提交
943 944

      const startLine = document.createElementNS(this.svg.namespaceURI, 'line');
945 946 947 948 949
      startLine.setAttribute('x1', x1);
      startLine.setAttribute('y1', startY);
      startLine.setAttribute('x2', x1);
      startLine.setAttribute('y2', startY + this.svg.cellHeight);
      startLine.setAttribute('style', 'stroke:#6c7280;stroke-width:1');
P
ph 已提交
950 951 952
      g.appendChild(startLine);

      const endLine = document.createElementNS(this.svg.namespaceURI, 'line');
953 954 955 956 957
      endLine.setAttribute('x1', x1 + width);
      endLine.setAttribute('y1', startY);
      endLine.setAttribute('x2', x1 + width);
      endLine.setAttribute('y2', startY + this.svg.cellHeight);
      endLine.setAttribute('style', 'stroke:#6c7280;stroke-width:1');
P
ph 已提交
958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002
      g.appendChild(endLine);
      g.appendChild(line);
      g.appendChild(text);
      return g;
    },
    getTextWidth(text) {
      const body = document.querySelector('body');
      const temp = document.createElement('span');
      temp.style['font-size'] = '12px';
      temp.textContent = text;
      body.appendChild(temp);
      const textWidth = temp.offsetWidth;
      body.removeChild(temp);
      return textWidth;
    },
    removeTrace() {
      const svgDom = document.querySelector('#trace svg');
      if (svgDom) {
        const gDoms = svgDom.children;
        if (gDoms) {
          for (let i = 0; i < gDoms.length; i++) {
            if (gDoms[i].nodeName === 'g') {
              svgDom.removeChild(gDoms[i--]);
            }
          }
        }
      }
    },
    resizeTrace() {
      if (this.svg.resizeTimer) {
        clearTimeout(this.svg.resizeTimer);
      }
      this.svg.resizeTimer = setTimeout(() => {
        this.removeTrace();
        this.dealTraceData();
        this.svg.resizeTimer = null;
      }, 500);
    },
    stringToUint8Array(str) {
      const arr = [];
      for (let i = 0, strLen = str.length; i < strLen; i++) {
        arr.push(str.charCodeAt(i));
      }
      return new Uint8Array(arr);
    },
P
ph 已提交
1003
    queryTimeline() {
F
fengxuefeng 已提交
1004
      this.timeLine.waiting = true;
P
ph 已提交
1005 1006 1007 1008 1009 1010
      const params = {
        dir: this.relativePath,
        device_id: this.currentCard,
      };
      RequestService.queryTimlineInfo(params)
          .then((res) => {
F
fengxuefeng 已提交
1011
            this.timelineInfo.initOver = true;
1012
            if (res && res.data) {
P
ph 已提交
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
              this.timelineInfo.noData = false;
              this.timelineInfo.totalTime = res.data.total_time.toFixed(4);
              this.timelineInfo.streamNum = res.data.num_of_streams;
              this.timelineInfo.opNum = res.data.num_of_ops;
              this.timelineInfo.opTimes = res.data.op_exe_times;
            } else {
              this.timelineInfo.noData = true;
            }
          })
          .catch(() => {
            this.timelineInfo.noData = true;
F
fengxuefeng 已提交
1024
            this.timelineInfo.initOver = true;
P
ph 已提交
1025
          });
1026 1027
      RequestService.queryTimeline(params)
          .then((res) => {
1028
            if (res && res.data && res.data.length) {
1029
              this.timeLine.data = this.stringToUint8Array(
1030 1031
                  JSON.stringify(res.data),
              );
1032
              this.timeLine.waiting = false;
1033 1034 1035
            }
          })
          .catch(() => {});
P
ph 已提交
1036
    },
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
    downloadPerfetto() {
      const downloadLink = document.createElement('a');
      downloadLink.download = this.getDocName();
      downloadLink.style.display = 'none';
      const blob = new Blob([this.timeLine.data]);
      downloadLink.href = URL.createObjectURL(blob);
      document.body.appendChild(downloadLink);
      downloadLink.click();
      document.body.removeChild(downloadLink);
    },
P
ph 已提交
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
    dealProcess(data) {
      this.processSummary.device = {
        empty: 0,
        full: 0,
        total: 0,
      };
      this.processSummary.get_next = {
        empty: 0,
        full: 0,
        total: 0,
      };
      this.processSummary.noData = true;

P
ph 已提交
1060
      if (data && Object.keys(data).length) {
P
ph 已提交
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
        if (data.device_queue_info && data.device_queue_info.summary) {
          this.processSummary.device = {
            empty: data.device_queue_info.summary.empty_batch_count,
            full: data.device_queue_info.summary.full_batch_count,
            total: data.device_queue_info.summary.total_batch,
          };
        }
        if (data.get_next_queue_info && data.get_next_queue_info.summary) {
          this.processSummary.get_next = {
            empty: data.get_next_queue_info.summary.empty_batch_count,
            full: data.get_next_queue_info.summary.full_batch_count,
            total: data.get_next_queue_info.summary.total_batch,
          };
        }
        this.processSummary.noData = false;
      }
    },
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
    getDocName() {
      const dealNumber = (value) => {
        const prefix = value < 10 ? '0' : '';
        return prefix + value;
      };
      const date = new Date();
      const year = date.getFullYear();
      const mouth = dealNumber(date.getMonth() + 1);
      const day = dealNumber(date.getDate());
      const hour = dealNumber(date.getHours());
      const minute = dealNumber(date.getMinutes());
      const second = dealNumber(date.getSeconds());
      const millisecond = date.getMilliseconds();
      const timestamp = `${year}${mouth}${day}${hour}${minute}${second}${millisecond}`;
      return `timeline_${this.trainingJobId}_${this.currentCard}_${timestamp}.json`;
    },
P
ph 已提交
1094 1095 1096
  },
  destroyed() {
    window.removeEventListener('resize', this.resizeTrace, false);
1097
    this.$bus.$off('collapse');
P
ph 已提交
1098 1099 1100 1101
  },
};
</script>
<style lang="scss">
P
ph 已提交
1102 1103 1104 1105 1106 1107
.el-tooltip-popper {
  max-width: 500px;
}
.tooltip-container {
  line-height: 20px;
  padding: 10px;
1108 1109 1110 1111 1112 1113 1114
  .font-style {
    font-weight: bold;
  }
  .font-size-style {
    font-weight: bold;
    font-size: 16px;
  }
P
ph 已提交
1115
}
P
ph 已提交
1116 1117 1118 1119 1120 1121
.pro-router-wrap {
  height: 100%;
  & > div {
    float: left;
    height: 100%;
    & > div {
P
ph 已提交
1122
      border: 1px solid #eee;
P
ph 已提交
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
      border-radius: 4px;
    }
    .title-wrap {
      padding: 15px;
      .title {
        float: left;
        font-weight: bold;
        font-size: 16px;
      }
      .tip-icon {
        float: right;
P
ph 已提交
1134
        margin-right: 10px;
P
ph 已提交
1135
        font-size: 20px;
P
ph 已提交
1136
        color: #6c7280;
P
ph 已提交
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
        .el-icon-warning {
          cursor: pointer;
          &:hover::before {
            color: #00a5a7;
          }
        }
      }
      .view-detail {
        float: right;
        cursor: pointer;
        color: #00a5a7;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        a {
          color: #00a5a7 !important;
          padding-right: 6px;
        }
        button {
          color: #00a5a7;
          border: none;
          background-color: #fff;
          cursor: pointer;
        }
        button.disabled {
          cursor: not-allowed;
          color: #c0c4cc;
        }
      }
      &::after {
        content: '';
        clear: both;
        display: block;
      }
    }
    .coming-soon-content {
      height: calc(100% - 50px);
      position: relative;
      .coming-soon-container {
        text-align: center;
        position: absolute;
        top: 50%;
        left: 50%;
        border-radius: 5px;
        -webkit-transform: translate(-50%, -50%);
        -moz-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
      }
      .coming-soon-text {
        font-size: 16px;
      }
    }
  }
  .pro-router-left {
P
ph 已提交
1191
    width: calc(100% - 400px);
P
ph 已提交
1192 1193 1194 1195 1196 1197
    padding-right: 15px;
    .step-trace {
      height: 45%;
      margin-bottom: 15px;
      .trace-container {
        width: 100%;
1198
        height: calc(100% - 54px);
P
ph 已提交
1199 1200 1201 1202
        overflow: auto;
        .training-trace {
          position: relative;
          height: 0;
1203 1204 1205 1206 1207 1208
          .content {
            overflow: hidden;
            text-align: center;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 12px;
1209
            line-height: 40px;
1210 1211 1212 1213
          }
          .content-mini {
            overflow: visible;
          }
P
ph 已提交
1214 1215 1216 1217 1218
        }
      }
    }
    .minddata {
      height: calc(55% - 15px);
P
ph 已提交
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294
      .pipeline-container {
        width: 100%;
        padding: 20px 20px;
        height: calc(100% - 52px);
        display: flex;
        font-size: 0;
        align-items: baseline;
        .cell-container {
          width: 20%;
          padding: 20px 0;
          border: 2px solid transparent;
          .title {
            font-size: 14px;
            line-height: 20px;
            padding: 0 0 0 20px;
            font-weight: bold;
          }
        }
        .data-process {
          background-color: #e3f8eb;
          .title {
            border-left: 2px solid #00a5a7;
          }
        }
        .device_queue_op {
          background-color: #e1f2ff;
          .title {
            border-left: 2px solid #6cbfff;
          }
        }
        .get-next {
          background-color: #fef4dd;
          .title {
            border-left: 2px solid #fdca5a;
          }
        }
        .queue-container {
          width: 20%;
          position: relative;
          .img {
            width: 100%;
            height: 24px;
            margin-top: 30px;
            .edge {
              width: calc(50% - 40px);
              display: inline-block;
              vertical-align: middle;
              img {
                width: 100%;
              }
            }
            .icon {
              padding: 0 20px;
              display: inline-block;
              vertical-align: middle;
              img {
                padding: 3px;
                border: 2px solid transparent;
              }
            }
          }

          .title {
            text-align: center;
            font-size: 14px;
            margin-top: 10px;
            font-weight: bold;
          }
          .description {
            position: absolute;
            font-size: 12px;
            line-height: 12px;
            white-space: nowrap;
            overflow: hidden;
            width: 100%;
            text-align: center;
P
ph 已提交
1295 1296 1297 1298 1299 1300 1301
            .line {
              width: 1px;
              height: 40px;
              margin: 20px 0;
              border-left: 1px solid #979797;
              display: inline-block;
            }
P
ph 已提交
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312
            .item {
              font-size: 12px;
              line-height: 16px;
              white-space: normal;
              .num {
                color: #07a695;
              }
            }
          }
        }
      }
P
ph 已提交
1313 1314 1315
    }
  }
  .pro-router-right {
P
ph 已提交
1316
    width: 400px;
P
ph 已提交
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373
    .op-time-consume {
      height: calc(60% - 15px);
      margin-bottom: 15px;
      .time-list {
        height: calc(40% - 52px);
        .item {
          height: 25px;
          line-height: 25px;
          padding: 0 20px;
          & > span {
            display: inline-block;
            height: 100%;
            vertical-align: middle;
          }
          .index {
            color: white;
            background-color: rgb(108, 146, 250);
            width: 20px;
            height: 20px;
            border-radius: 20px;
            text-align: center;
            vertical-align: middle;
            line-height: 20px;
          }
          .name {
            margin-left: 10px;
            width: calc(50% - 30px);
            text-overflow: ellipsis;
            overflow: hidden;
          }
          .num {
            width: 20%;
          }
          .time {
            width: 30%;
            position: relative;
            span {
              display: inline-block;
              position: absolute;
              left: 0;
              height: 20px;
            }
            .bar {
              background-color: #cceded;
              top: 2px;
            }
            .value {
              line-height: 25px;
              height: 25px;
            }
          }
        }
      }
    }
    .time-line {
      height: 40%;
      overflow: hidden;
P
ph 已提交
1374 1375 1376 1377 1378 1379 1380 1381
      .timeline-info {
        width: 100%;
        height: calc(100% - 54px);
        padding-left: 36px;
      }
      .info-line {
        line-height: 30px;
      }
P
ph 已提交
1382 1383 1384 1385 1386 1387 1388 1389 1390
    }
  }
  .op-time-content {
    height: calc(100% - 54px);
    overflow: auto;
  }
  .pie-chart {
    width: 100%;
    height: 260px;
1391
    overflow: hidden;
P
ph 已提交
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406
  }
  .image-noData {
    width: 100%;
    height: calc(100% - 52px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    p {
      font-size: 16px;
      padding-top: 10px;
    }
  }
}
</style>