Skip to content

Commit 96dffd9

Browse files
committed
Update responetime str to timeout if timeout
1 parent 6eaefed commit 96dffd9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Components.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default class Instances extends Component{
2727
const frames = this.props.components.frames;
2828
const comments = this.props.components.comments;
2929
for(var i=0; i < frames.length; i++){
30+
frames[i].timeout = this.props.components.timeout;
3031
if(frames[i].responseTime === null || frames[i].responseTime >= this.props.components.timeout){
3132
frames[i].responseTime = this.props.components.timeout;
3233
}
@@ -120,10 +121,16 @@ export default class Instances extends Component{
120121
function CustomTooltip({active, payload}) {
121122
if(active){
122123
const timestamp = new Date(payload[0].payload.timestamp).toLocaleString()
124+
let responseTime = payload[0].payload.responseTime
125+
if (responseTime === payload[0].payload.timeout) {
126+
responseTime = "Timeout"
127+
} else {
128+
responseTime = responseTime + "ms"
129+
}
123130
return(
124131
<div className="tooltip">
125132
<p>{timestamp}</p>
126-
<p className={"tooltip-entry"}>ResponseTime: {payload[0].payload.responseTime}ms</p>
133+
<p className={"tooltip-entry"}>ResponseTime: {responseTime}</p>
127134
<p className={"tooltip-entry"}>CPU usage: {payload[0].payload.cpu}%</p>
128135
{payload[0].payload.comment !== undefined &&
129136
<p className={"tooltip-entry"}>Comment: {payload[0].payload.comment}</p>

0 commit comments

Comments
 (0)