This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add trace-detail display page with table
- Loading branch information
1 parent
3e78e9c
commit a0ff494
Showing
17 changed files
with
521 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
src/views/components/trace/trace-chart-table/trace-container.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<div class="trace"> | ||
<div class="trace-header"> | ||
<div class="method"> | ||
Method | ||
</div> | ||
<div class="start-time"> | ||
Start Time | ||
</div> | ||
<div class="gap"> | ||
Gap(ms) | ||
</div> | ||
<div class="exec-ms"> | ||
Exec(ms) | ||
</div> | ||
<div class="exec-percent"> | ||
Exec(%) | ||
</div> | ||
<div class="self"> | ||
Self(ms) | ||
</div> | ||
<div class="api"> | ||
API | ||
</div> | ||
<div class="application"> | ||
Service | ||
</div> | ||
</div> | ||
|
||
<slot> </slot> | ||
</div> | ||
</template> | ||
<style lang="scss" scoped> | ||
@import './trace.scss'; | ||
.trace { | ||
font-size: 12px; | ||
height: 100%; | ||
overflow: auto; | ||
} | ||
.trace-header { | ||
display: flex; | ||
border-left: 0; | ||
border-right: 0; | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.1); | ||
} | ||
.trace-header div { | ||
padding: 0 4px; | ||
border: 1px solid transparent; | ||
border-right: 1px dotted silver; | ||
line-height: 30px; | ||
background-color: #f3f4f9;; | ||
padding: 0 4px; | ||
border: 1px solid transparent; | ||
border-right: 1px dotted silver; | ||
overflow: hidden; | ||
line-height: 30px; | ||
overflow:hidden; | ||
text-overflow:ellipsis; | ||
white-space:nowrap | ||
} | ||
</style> | ||
|
184 changes: 184 additions & 0 deletions
184
src/views/components/trace/trace-chart-table/trace-item.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
<template> | ||
<div> | ||
<div @click="showSelectSpan" :class="['trace-item', 'level'+( data.level - 1)]"> | ||
<div :class="['method', 'level'+( data.level - 1)]" :style="{'text-indent': (data.level - 1) * 10 + 'px' }"> | ||
<span | ||
v-if="data.children && data.children.length > 0" | ||
@click.stop="toggle" | ||
:class="['trace-table-toggle', displayChildren? 'collapse': 'expand']"> | ||
|
||
</span> | ||
<span v-tooltip:bottom="{content: data.endpointName, popperCls: ['trace-table-tooltip']}"> | ||
{{data.endpointName}} | ||
</span> | ||
</div> | ||
<div class="start-time"> | ||
{{formatTime(data.startTime)}} | ||
</div> | ||
<div class="gap"> | ||
0 | ||
</div> | ||
<div class="exec-ms"> | ||
{{(data.endTime - data.startTime)?(data.endTime - data.startTime) : '0'}} | ||
</div> | ||
<div class="exec-percent"> | ||
<div class="outer-progress_bar" :style="{width: outterPercent}"> | ||
<div class="inner-progress_bar" :style="{width: innerPercent}"></div> | ||
</div> | ||
</div> | ||
<div class="self"> | ||
{{data.dur ? data.dur + '' : '0'}} | ||
</div> | ||
<div class="api"> | ||
<span v-tooltip:bottom="data.component||'-'">{{data.component || '-'}}</span> | ||
</div> | ||
<div class="application"> | ||
<span v-tooltip:bottom="data.serviceCode||'-'">{{data.serviceCode}}</span> | ||
</div> | ||
</div> | ||
<div v-show="data.children && data.children.length > 0 && displayChildren" class="children-trace"> | ||
<item v-for="(item, index) in data.children" :key="index" :data="item"> </item> | ||
</div> | ||
</div> | ||
|
||
</template> | ||
<style lang="scss" scoped> | ||
@import './trace.scss'; | ||
.trace-item.level0{ | ||
background: rgba(0, 0, 0, 0.04);; | ||
color: #448dfe; | ||
&:hover { | ||
background: rgba(0, 0, 0, 0.04);; | ||
color: #448dfe; | ||
} | ||
&::before{ | ||
position: absolute; | ||
content: ''; | ||
width: 5px; | ||
height: 100%; | ||
background: #448dfe; | ||
left: 0; | ||
} | ||
} | ||
.trace-table-toggle { | ||
cursor: pointer; | ||
height: 12px; | ||
width: 12px; | ||
display: inline-block; | ||
&.collapse { | ||
background: url('./collapse.gif') no-repeat; | ||
background-size: 12px 12px; | ||
} | ||
&.expand { | ||
background: url('./expand.gif') no-repeat; | ||
background-size: 12px 12px; | ||
} | ||
} | ||
.trace-item { | ||
display: flex; | ||
position: relative; | ||
} | ||
.trace-item.selected { | ||
background: rgba(0, 0, 0, 0.04); | ||
} | ||
.trace-item:not(.level0):hover { | ||
background: rgba(0, 0, 0, 0.04); | ||
} | ||
.trace-item>div { | ||
padding: 0 5px; | ||
border: 1px solid transparent; | ||
border-right: 1px dotted silver; | ||
overflow: hidden; | ||
line-height: 30px; | ||
overflow:hidden; | ||
text-overflow:ellipsis; | ||
white-space:nowrap | ||
} | ||
.trace-item>div.method { | ||
padding-left: 10px; | ||
} | ||
.trace-item div.exec-percent { | ||
width: 10%; | ||
padding-left: 8px; | ||
padding-right: 8px; | ||
.outer-progress_bar { | ||
width: 100%; | ||
height: 6px; | ||
border-radius: 3px; | ||
background: rgb(63, 177, 227); | ||
position: relative; | ||
margin-top: 11px; | ||
border: none; | ||
} | ||
.inner-progress_bar { | ||
position: absolute; | ||
background: rgb(110, 64, 170); | ||
height: 4px; | ||
border-radius: 2px; | ||
left: 0; | ||
border:none; | ||
top: 1px; | ||
} | ||
} | ||
</style> | ||
<script type="text/javascript"> | ||
import moment from 'dayjs'; | ||
import Popper from 'popper.js'; | ||
export default { | ||
name: 'item', | ||
props: ['data'], | ||
data() { | ||
return { | ||
displayChildren: true, | ||
}; | ||
}, | ||
computed: { | ||
selfTime() { | ||
const {data} = this; | ||
return data.dur ? data.dur : 0; | ||
}, | ||
execTime() { | ||
const {data} = this; | ||
return (data.endTime - data.startTime) ? (data.endTime - data.startTime) : 0; | ||
}, | ||
outterPercent() { | ||
if (this.data.level === 1) { | ||
return '100%'; | ||
} else { | ||
const data = this.data; | ||
const exec = (data.endTime - data.startTime) ? (data.endTime - data.startTime) : 0; | ||
let result = (exec / data.totalExec * 100); | ||
result = result > 100 ? 100 : result; | ||
result = result.toFixed(4) + '%'; | ||
return result === '0.0000%' ? '0.9%' : result; | ||
} | ||
}, | ||
innerPercent() { | ||
const result = (this.selfTime / this.execTime) * 100 .toFixed(4) + '%'; | ||
return result === '0.0000%' ? '0.9%' : result; | ||
}, | ||
eventHub() { | ||
return this.$store.getters.globalEventHub; | ||
}, | ||
}, | ||
methods: { | ||
toggle() { | ||
this.displayChildren = ! this.displayChildren; | ||
}, | ||
formatTime(timestamp) { | ||
return moment(timestamp).format('HH:mm:ss SSS'); | ||
}, | ||
showSelectSpan() { | ||
this.eventHub.$emit('HANDLE-SELECT-SPAN', this.data); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.method { | ||
width: 45%; | ||
} | ||
.argument { | ||
width: 15%; | ||
} | ||
.start-time { | ||
width: 5%; | ||
min-width: 100px; | ||
} | ||
.gap { | ||
width: 5%; | ||
} | ||
.exec-ms { | ||
width: 6%; | ||
} | ||
.exec-percent { | ||
width: 10%; | ||
} | ||
.self { | ||
width: 5%; | ||
} | ||
.api { | ||
width: 10%; | ||
} | ||
.agent { | ||
width: 15%; | ||
} | ||
.application { | ||
width: 15%; | ||
} |
Oops, something went wrong.