1
0
Fork 0

ui query profiling

This commit is contained in:
hkernbach 2016-10-13 14:45:54 +02:00
parent c9df6c29ec
commit 0d75ebe3aa
1 changed files with 35 additions and 6 deletions

View File

@ -1937,6 +1937,7 @@
var pos = 0;
var width;
var adjustWidth = 0;
_.each(data, function (value, key) {
var ms = numeral(value * 1000).format('0.000');
@ -1952,13 +1953,41 @@
);
width = Math.floor((value * 1000) / total * 100);
if (width === 0) {
width = 1;
adjustWidth++;
}
if (pos !== 6) {
queryProfile.find('.prof-progress').append(
'<div style="width: ' + width + '%; background-color: ' + colors[pos] + '"></div>'
);
if (width > 1) {
queryProfile.find('.prof-progress-label').append(
'<div style="width: ' + width + '%;">' + legend[pos] + '</div>'
);
} else {
queryProfile.find('.prof-progress-label').append(
'<div style="width: ' + width + '%; font-size: 9px">' + legend[pos] + '</div>'
);
}
} else {
if (adjustWidth > 0) {
width = width - adjustWidth;
}
queryProfile.find('.prof-progress').append(
'<div style="width: ' + width + '%; background-color: ' + colors[pos] + '"></div>'
);
if (width > 1) {
queryProfile.find('.prof-progress-label').append(
'<div style="width: ' + width + '%;">' + legend[pos] + '</div>'
);
} else {
queryProfile.find('.prof-progress-label').append(
'<div style="width: ' + width + '%; font-size: 9px">' + legend[pos] + '</div>'
);
}
}
pos++;
});