Skip to content

Commit

Permalink
Apdex Score, closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
sv2 committed Nov 8, 2017
1 parent 7566c40 commit 1b94b4a
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 5 deletions.
41 changes: 39 additions & 2 deletions ui/sws.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,14 @@

// Update Widgets
$('#sws_summ_wRq').swswidget('setvalue', { value:this.apistats.all.requests, trend: this.getTimelineTrend('stats','requests')} );
$('#sws_summ_wRp').swswidget('setvalue', { value:(this.apistats.all.requests-this.apistats.all.responses) } );
//$('#sws_summ_wRp').swswidget('setvalue', { value:(this.apistats.all.requests-this.apistats.all.responses) } );

$('#sws_summ_wApd').swswidget('setvalue', { value: this.apistats.all.apdex_score.toFixed(2), customtrend: function(elemTrend){
var apd1 = that.apistats.all.apdex_score.toFixed(2)*100;
elemTrend.append($('<div class="swsbox-trend-container"><span class="pie">'+apd1+'/100</span></div>'));
elemTrend.find('.pie').peity("donut",{ fill: ["#ff9900", "#e7eaec"], radius:30, innerRadius: 16 });
}});

$('#sws_summ_wRRte').swswidget('setvalue', { value:this.getLatestTimelineValue('stats','req_rate').toFixed(4), extra:'req/sec', trend: this.getTimelineTrend('stats','req_rate')} );
$('#sws_summ_wERte').swswidget('setvalue', { value:this.getLatestTimelineValue('stats','err_rate').toFixed(4), extra:'err/sec', trend: this.getTimelineTrend('stats','err_rate')} );
$('#sws_summ_wAHt').swswidget('setvalue', this.formatWValDurationMS({value:this.apistats.all.avg_time}) );
Expand Down Expand Up @@ -1082,24 +1089,48 @@
// Update values on Rates page
SWSUI.prototype.updateRates = function() {

var that = this;

// Update values, if we have data
if(this.apistats==null) return;

// Update Widgets
//$('#sws_rates_wApd').swswidget('setvalue', { value:this.getLatestTimelineValue('stats','apdex_score').toFixed(2), extra:'', trend: this.getTimelineTrend('stats','apdex_score')} );

$('#sws_rates_wApd').swswidget('setvalue', { value: this.getLatestTimelineValue('stats','apdex_score').toFixed(2), customtrend: function(elemTrend){
var apd1 = that.getLatestTimelineValue('stats','apdex_score').toFixed(2)*100;
elemTrend.append($('<div class="swsbox-trend-container"><span class="pie">'+apd1+'/100</span></div>'));
elemTrend.find('.pie').peity("donut",{ fill: ["#ff9900", "#e7eaec"], radius:30, innerRadius: 16 });
}});


$('#sws_rates_wRqR').swswidget('setvalue', { value:this.getLatestTimelineValue('stats','req_rate').toFixed(4), extra:'req/sec', trend: this.getTimelineTrend('stats','req_rate')} );
$('#sws_rates_wErR').swswidget('setvalue', { value:this.getLatestTimelineValue('stats','err_rate').toFixed(4), extra:'err/sec', trend: this.getTimelineTrend('stats','err_rate')} );
$('#sws_rates_wMHT').swswidget('setvalue', this.formatWValDurationMS({ value:this.getLatestTimelineValue('stats','max_time'), trend: this.getTimelineTrend('stats','max_time')}) );
$('#sws_rates_wAHT').swswidget('setvalue', this.formatWValDurationMS({ value:this.getLatestTimelineValue('stats','avg_time'), trend: this.getTimelineTrend('stats','avg_time')},2) );
$('#sws_rates_wSHT').swswidget('setvalue', this.formatWValDurationMS({ value:this.getLatestTimelineValue('stats','total_time'), trend: this.getTimelineTrend('stats','total_time')}) );


//$('#sws_rates_wOApd').swswidget('setvalue', { value:this.apistats.all.apdex_score.toFixed(2),extra:'' } );
$('#sws_rates_wOApd').swswidget('setvalue', { value: this.apistats.all.apdex_score.toFixed(2), customtrend: function(elemTrend){
var apd1 = that.apistats.all.apdex_score.toFixed(2)*100;
elemTrend.append($('<div class="swsbox-trend-container"><span class="pie">'+apd1+'/100</span></div>'));
elemTrend.find('.pie').peity("donut",{ fill: ["#ff9900", "#e7eaec"], radius:30, innerRadius: 16 });
}});

$('#sws_rates_wORqR').swswidget('setvalue', { value:this.apistats.all.req_rate.toFixed(4),extra:'req/sec' } );
$('#sws_rates_wOErR').swswidget('setvalue', { value:this.apistats.all.err_rate.toFixed(4),extra:'err/sec' } );
$('#sws_rates_wOMHT').swswidget('setvalue', this.formatWValDurationMS({value:this.apistats.all.max_time}) );
$('#sws_rates_wOAHT').swswidget('setvalue', this.formatWValDurationMS({value:this.apistats.all.avg_time}) );
$('#sws_rates_wOSHT').swswidget('setvalue', this.formatWValDurationMS({value:this.apistats.all.total_time}) );


// Update Apdex Score Chart
var elemApdexChart = $('#sws_rates_cApd');
this.buildTimeSeriesChartData(elemApdexChart.swschart('getchartdata'),'stats',['apdex_score']);
elemApdexChart.swschart('update');


// Update timeline charts
var elemReqErrRateChart = $('#sws_rates_cRER');
this.buildTimeSeriesChartData(elemReqErrRateChart.swschart('getchartdata'),'stats',['req_rate','err_rate']);
Expand Down Expand Up @@ -1230,9 +1261,15 @@
// Update Widgets
$('#sws_apiop_wRq').swswidget('setvalue', { value: opStats.requests} );

$('#sws_apiop_wApd').swswidget('setvalue', { value: opStats.apdex_score.toFixed(2), customtrend: function(elemTrend){
var apd1 = opStats.apdex_score.toFixed(2)*100;
elemTrend.append($('<div class="swsbox-trend-container"><span class="pie">'+apd1+'/100</span></div>'));
elemTrend.find('.pie').peity("donut",{ fill: ["#ff9900", "#e7eaec"], radius:30, innerRadius: 16 });
}});

$('#sws_apiop_wRRte').swswidget('setvalue', { value:opStats.req_rate.toFixed(4), extra:'req/sec' } );
$('#sws_apiop_wERte').swswidget('setvalue', { value:opStats.err_rate.toFixed(4), extra:'err/sec' } );
$('#sws_apiop_wMHt').swswidget('setvalue', this.formatWValDurationMS({value:opStats.max_time}) );
//$('#sws_apiop_wMHt').swswidget('setvalue', this.formatWValDurationMS({value:opStats.max_time}) );
$('#sws_apiop_wAHt').swswidget('setvalue', this.formatWValDurationMS({value:opStats.avg_time}) );
$('#sws_apiop_wRrCl').swswidget('setvalue', { value:opStats.avg_req_clength, extra:'bytes'} );

Expand Down
31 changes: 28 additions & 3 deletions ui/swsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ var SWSLayout = function(){
r1: {
columns: {
sws_summ_wRq : { class:"col-md-2", type: "widget", title: 'Requests', subtitle:'Total requests received' },
sws_summ_wRp : { class:"col-md-2", type: "widget", title: 'Processing', subtitle:'Requests in processing' },
//sws_summ_wRp : { class:"col-md-2", type: "widget", title: 'Processing', subtitle:'Requests in processing' },
sws_summ_wApd : { class:"col-md-2", type: "widget", title: 'Apdex Score', subtitle:'Overall Apdex Score', postProcess:'successIfNonZero' },
sws_summ_wRRte: { class:"col-md-2", type: "widget", title: 'Current Req Rate', subtitle:'Req rate on last time interval', postProcess:'successIfNonZero' },
sws_summ_wERte: { class:"col-md-2", type: "widget", title: 'Current Err Rate', subtitle:'Err rate on last time interval', postProcess:'redIfNonZero' },
sws_summ_wCpu: { class:"col-md-2", type: "widget", title: 'CPU Usage', subtitle:'Process CPU Usage %', postProcess:'redIfNonZero' },
Expand Down Expand Up @@ -606,6 +607,7 @@ var SWSLayout = function(){
},
r1: {
columns: {
sws_rates_wApd : { class:"col-md-2", type: "widget", title: 'Current Apdex Score', subtitle:'Apdex Score on last time interval', postProcess:'successIfNonZero' },
sws_rates_wRqR : { class:"col-md-2", type: "widget", title: 'Current Req Rate', subtitle:'Req rate on last time interval', postProcess:'successIfNonZero' },
sws_rates_wErR: { class:"col-md-2", type: "widget", title: 'Current Err Rate', subtitle:'Err rate on last time interval', postProcess:'redIfNonZero' },
sws_rates_wMHT : { class:"col-md-2", type: "widget", title: 'Current Max HT', subtitle:'Longest Req on last 60 sec',postProcess:'successIfNonZero' },
Expand All @@ -615,14 +617,37 @@ var SWSLayout = function(){
},
r2: {
columns: {
sws_rates_wOApd : { class:"col-md-2", type: "widget", title: 'Overall Apdex Score', subtitle:'Apdex Score of all time',postProcess:'successIfNonZero' },
sws_rates_wORqR : { class:"col-md-2", type: "widget", title: 'Overall Req Rate', subtitle:'Req rate of all time',postProcess:'successIfNonZero' },
sws_rates_wOErR : { class:"col-md-2", type: "widget", title: 'Overall Err Rate', subtitle:'Err rate of all time',postProcess:'redIfNonZero' },
sws_rates_wOMHT : { class:"col-md-2", type: "widget", title: 'Overall Max HT', subtitle:'Longest Req of all time' },
sws_rates_wOAHT : { class:"col-md-2", type: "widget", title: 'Overall Avg HT', subtitle:'Avg Handle Time of all time' },
sws_rates_wOSHT : { class:"col-md-2", type: "widget", title: 'Overall HT', subtitle:'Sum Handle Time of all time' }
}
},

r3: {
columns: {
sws_rates_cApd : {
class:"col-lg-12",
type: "chart",
options: { title:'Apdex Score Trend', type: 'line', height:"140px" },
chartdata: {
labels: [],
datasets: [
{ label: "Apdex Score", borderColor: '#FCE38A', backgroundColor: '#FCE38A',data: [] }
]
},
chartoptions : {
responsive: true,
maintainAspectRatio: false,
legend: { display: false }
}
}
}
},

r4: {
columns: {
sws_rates_cRER : {
class:"col-lg-12",
Expand Down Expand Up @@ -876,10 +901,10 @@ var SWSLayout = function(){
r2: {
columns: {
sws_apiop_wRq : { class:"col-md-2", type: "widget", title: 'Requests', subtitle:'Total received requests' },
sws_apiop_wApd : { class:"col-md-2", type: "widget", title: 'Apdex Score', subtitle:'Overall Apdex Score', postProcess:'successIfNonZero' },
sws_apiop_wRRte: { class:"col-md-2", type: "widget", title: 'Req Rate', subtitle:'Overall Req rate', postProcess:'successIfNonZero' },
sws_apiop_wERte: { class:"col-md-2", type: "widget", title: 'Err Rate', subtitle:'Overall Err rate', postProcess:'redIfNonZero' },
sws_apiop_wAHt : { class:"col-md-2", type: "widget", title: 'Avg HT', subtitle:'Average Handle Time' },
sws_apiop_wMHt : { class:"col-md-2", type: "widget", title: 'Max HT', subtitle:'Longest Req of all time' },
sws_apiop_wRrCl: { class:"col-md-2", type: "widget", title: 'Avg Req Payload', subtitle:'Avg req content len' }
}
},
Expand Down Expand Up @@ -948,7 +973,7 @@ var SWSLayout = function(){
sws_apiop_tParams: {
class:"col-lg-8",
type: "datatable",
options: {expand:true},
options: {expand:true,title: 'Parameters'},
dataTableSettings:{
pageLength: 25,
columns: [
Expand Down

0 comments on commit 1b94b4a

Please sign in to comment.