Changeset 7280


Ignore:
Timestamp:
May 17, 2018, 1:03:30 PM (15 months ago)
Author:
mabarracus
Message:

Fix graph empty spaces
Add clean scripts

Location:
lliurex-analytics-server/trunk/fuentes
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/debian/changelog

    r7204 r7280  
     1lliurex-analytics-server (0.2.6.5) xenial; urgency=medium
     2
     3  * Fix graph empty spaces
     4  * Add clean scripts
     5
     6 -- M.Angel Juan <m.angel.juan@gmail.com>  Thu, 17 May 2018 13:01:42 +0200
     7
    18lliurex-analytics-server (0.2.6.4) xenial; urgency=medium
    29
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/functions.php

    r6876 r7280  
    5050            $data = json_decode($data,true);
    5151        }
     52        $sql_pre = 'truncate PackagesWhitelist;';
    5253        $sql = 'insert into `PackagesWhitelist` (`name`,`status`) values ';
    5354        $str = '';
     
    5859            $str .= "('$item',1),";
    5960        }
    60         foreach ($data['unk'] as $item){
    61             $str .= "('$item',NULL),";
    62         }
     61//        foreach ($data['unk'] as $item){
     62//            $str .= "('$item',NULL),";
     63//        }
    6364        $l=strlen($str);
    6465        if ($l < 1)
     
    7071        $db->connect();
    7172        try{
    72             $db->dbconn->query($sql);
     73            $db->dbconn->query($sql_pre);
     74            try{
     75                $db->dbconn->query($sql);
     76            }catch(Exception $e){
     77                return 'NOK';
     78            }
    7379        }catch(Exception $e){
    7480            return 'NOK';
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/graph.js

    r7204 r7280  
    11function drawChart(datos,title,id,nelements) {
    22  var custom_width=$('#'+id).parent().width()*0.95;
    3   if (nelements < 10){
    4     var custom_height=$(window).height()/3*0.75;
    5   }else{
     3//  if (nelements < 10){
     4//    var custom_height=$(window).height()/3*0.75;
     5//  }else{
    66    var custom_height=20*nelements;
    7   }
     7//  }
    88
    99  // Set chart options
     10//chartArea:{left:'10%',right:'5%'},
    1011  var options = {title:title,
    1112                 width: custom_width,
     
    1819                    }
    1920                 },
    20                 chartArea:{left:'10%',right:'5%'},
     21                chartArea:{left:'10%',right:'5%',top:'50',width:'100%',height:'100%'},
    2122                };
    2223
     
    3738    var custom_width=$('#'+id).parent().width()*0.95;
    3839    var custom_height=$(window).height()*0.72/2;
     40    custom_width='auto';
     41    custom_height='auto';
    3942    switch(id){
    4043        case 'clients_per_month':
     
    981984
    982985    $('#loading').remove();
    983     $('#accordion').accordion({active:false,collapsible:true});
     986    $('#accordion').accordion({active:false,collapsible:true,heightStyle: "content",autoHeight:false});
    984987    if (app != null){
    985988        $('.app_use').click();
     
    10771080    if (num_ready == max_graph){
    10781081        $('#accordion>#loading').remove()
    1079         $('#accordion').accordion({active:false,collapsible:true});
     1082        $('#accordion').accordion({active:false,collapsible:true,heightStyle: "content",autoHeight:false});
    10801083
    10811084    }
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/graph_min.js

    r7204 r7280  
    1 function drawChart(g,e,b,c){var d=.95*$("#"+b).parent().width();c=10>c?$(window).height()/3*.75:20*c;e={title:e,width:d,height:c,fontSize:10,legend:"none",hAxis:{viewWindow:{min:0}},chartArea:{left:"10%",right:"5%"}};g=new google.visualization.DataView(g);g.setColumns([0,1,{calc:"stringify",sourceColumn:1,type:"string",role:"annotation"}]);b=new google.visualization.BarChart(document.getElementById(b));google.visualization.events.addListener(b,"ready",ready_charts);b.draw(g,e)}
    2 function get_sizes(g){g=.95*$("#"+g).parent().width();var e=.72*$(window).height()/2;return{width:g,height:e}}
    3 function build_data_per_month_releases(g,e){var b=[];for(i=0;12>i;i++)if(b[i]={15:0,16:0,all:0},g[i]){for(rel in g[i]){if("15"==rel)for(fla in g[i][rel])b[i][rel]+=g[i][rel][fla];if("16"==rel)for(fla in g[i][rel])b[i][rel]+=g[i][rel][fla]}b[i].all=b[i]["15"]+b[i]["16"]}var c=[],d=new Date,f=new google.visualization.DataTable;f.addColumn({type:"date",role:"domain"},"Release");f.addColumn("number","Total Release 15");f.addColumn({type:"string",role:"style"},"Style Release 15");f.addColumn("number",
    4 "Total Release 16");f.addColumn({type:"string",role:"style"},"Style Release 16");f.addColumn("number","Total ALL Releases");f.addColumn({type:"string",role:"style"},"Style ALL Releases");date_values=[];for(i=1;12>=i;i++)month=d.getMonth(),year=d.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[i-1]["15"],"color:blue",b[i-1]["16"],"color:red",b[i-1].all,"color:grey"]),d.setMonth(month-1);f.addRows(date_values);return{data:f,options:{title:e,curveType:"function",
    5 isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["blue","red","grey"],lineWidth:5}}}
    6 function build_data_per_month_flavours(g,e){var b=[];for(i=0;12>i;i++)if(b[i]={server:0,client:0,desktop:0,other:0,all:0},g[i])for(rel in g[i])for(fla in g[i][rel])b[i][fla]+=g[i][rel][fla],b[i].all+=g[i][rel][fla];var c=[],d=new Date,f=new google.visualization.DataTable;f.addColumn({type:"date",role:"domain"},"Flavour");f.addColumn("number","Total Server");f.addColumn({type:"string",role:"style"},"Style Server");f.addColumn("number","Total Client");f.addColumn({type:"string",role:"style"},"Style Client");
    7 f.addColumn("number","Total Desktop");f.addColumn({type:"string",role:"style"},"Style Desktop");f.addColumn("number","Total Other");f.addColumn({type:"string",role:"style"},"Style Other");f.addColumn("number","Total ALL Flavours");f.addColumn({type:"string",role:"style"},"Style Total ALL Flavours");date_values=[];for(i=1;12>=i;i++)month=d.getMonth(),year=d.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[i-1].server,"color:purple",b[i-1].client,"color:teal",
    8 b[i-1].desktop,"color:gold",b[i-1].other,"color:olive",b[i-1].all,"color:grey"]),d.setMonth(month-1);f.addRows(date_values);return{data:f,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","teal","gold","olive","grey"],lineWidth:5}}}
    9 function build_data_per_month_arch(g,e){for(var b=[],c=0;12>c;c++)if(b[c]={i386:0,x86_64:0},g[c])for(var d in g[c])for(var f in g[c][d])for(var a in g[c][d][f])b[c][a]+=g[c][d][f][a];d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total x86");a.addColumn({type:"string",role:"style"},"Style x86");a.addColumn("number","Total x86_64");a.addColumn({type:"string",role:"style"},"Style x86_64");date_values=[];for(c=1;12>=c;c++)month=
    10 f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].i386,"color:purple",b[c-1].x86_64,"color:gold"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","gold"],lineWidth:5}}}
    11 function build_data_per_month_release_arch(g,e){for(var b=[],c=0;12>c;c++)if(b[c]={"15_i386":0,"15_x86_64":0,"16_i386":0,"16_x86_64":0},g[c])for(var d in g[c])for(var f in g[c][d])for(var a in g[c][d][f])b[c][d+"_"+a]+=g[c][d][f][a];d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 x86");a.addColumn({type:"string",role:"style"},"Style 15 x86");a.addColumn("number","Total 15 x86_64");a.addColumn({type:"string",role:"style"},
    12 "Style 15 x86_64");a.addColumn("number","Total 16 x86");a.addColumn({type:"string",role:"style"},"Style 16 x86");a.addColumn("number","Total 16 x86_64");a.addColumn({type:"string",role:"style"},"Style 16 x86_64");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1]["15_i386"],"color:purple",b[c-1]["15_x86_64"],"color:gold",b[c-1]["16_i386"],"color:teal",b[c-1]["16_x86_64"],"color:olive"]),
    13 f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","gold","teal","olive"],lineWidth:5}}}
    14 function build_data_per_month_flavour_arch(g,e){for(var b=[],c=0;12>c;c++)if(b[c]={client_i386:0,client_x86_64:0,server_i386:0,server_x86_64:0,desktop_i386:0,desktop_x86_64:0,other_i386:0,other_x86_64:0},g[c])for(var d in g[c])for(var f in g[c][d])for(var a in g[c][d][f])b[c][f+"_"+a]+=g[c][d][f][a];d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total client x86");a.addColumn({type:"string",role:"style"},"Style client x86");
     1function drawChart(g,e,b,d){var c=.95*$("#"+b).parent().width();e={title:e,width:c,height:20*d,fontSize:10,legend:"none",hAxis:{viewWindow:{min:0}},chartArea:{left:"10%",right:"5%",top:"50",width:"100%",height:"100%"}};g=new google.visualization.DataView(g);g.setColumns([0,1,{calc:"stringify",sourceColumn:1,type:"string",role:"annotation"}]);b=new google.visualization.BarChart(document.getElementById(b));google.visualization.events.addListener(b,"ready",ready_charts);b.draw(g,e)}
     2function get_sizes(g){$("#"+g).parent().width();$(window).height();return{width:"auto",height:"auto"}}
     3function build_data_per_month_releases(g,e){var b=[];for(i=0;12>i;i++)if(b[i]={15:0,16:0,all:0},g[i]){for(rel in g[i]){if("15"==rel)for(fla in g[i][rel])b[i][rel]+=g[i][rel][fla];if("16"==rel)for(fla in g[i][rel])b[i][rel]+=g[i][rel][fla]}b[i].all=b[i]["15"]+b[i]["16"]}var d=[],c=new Date,f=new google.visualization.DataTable;f.addColumn({type:"date",role:"domain"},"Release");f.addColumn("number","Total Release 15");f.addColumn({type:"string",role:"style"},"Style Release 15");f.addColumn("number",
     4"Total Release 16");f.addColumn({type:"string",role:"style"},"Style Release 16");f.addColumn("number","Total ALL Releases");f.addColumn({type:"string",role:"style"},"Style ALL Releases");date_values=[];for(i=1;12>=i;i++)month=c.getMonth(),year=c.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[i-1]["15"],"color:blue",b[i-1]["16"],"color:red",b[i-1].all,"color:grey"]),c.setMonth(month-1);f.addRows(date_values);return{data:f,options:{title:e,curveType:"function",
     5isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["blue","red","grey"],lineWidth:5}}}
     6function build_data_per_month_flavours(g,e){var b=[];for(i=0;12>i;i++)if(b[i]={server:0,client:0,desktop:0,other:0,all:0},g[i])for(rel in g[i])for(fla in g[i][rel])b[i][fla]+=g[i][rel][fla],b[i].all+=g[i][rel][fla];var d=[],c=new Date,f=new google.visualization.DataTable;f.addColumn({type:"date",role:"domain"},"Flavour");f.addColumn("number","Total Server");f.addColumn({type:"string",role:"style"},"Style Server");f.addColumn("number","Total Client");f.addColumn({type:"string",role:"style"},"Style Client");
     7f.addColumn("number","Total Desktop");f.addColumn({type:"string",role:"style"},"Style Desktop");f.addColumn("number","Total Other");f.addColumn({type:"string",role:"style"},"Style Other");f.addColumn("number","Total ALL Flavours");f.addColumn({type:"string",role:"style"},"Style Total ALL Flavours");date_values=[];for(i=1;12>=i;i++)month=c.getMonth(),year=c.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[i-1].server,"color:purple",b[i-1].client,"color:teal",
     8b[i-1].desktop,"color:gold",b[i-1].other,"color:olive",b[i-1].all,"color:grey"]),c.setMonth(month-1);f.addRows(date_values);return{data:f,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","teal","gold","olive","grey"],lineWidth:5}}}
     9function build_data_per_month_arch(g,e){for(var b=[],d=0;12>d;d++)if(b[d]={i386:0,x86_64:0},g[d])for(var c in g[d])for(var f in g[d][c])for(var a in g[d][c][f])b[d][a]+=g[d][c][f][a];c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total x86");a.addColumn({type:"string",role:"style"},"Style x86");a.addColumn("number","Total x86_64");a.addColumn({type:"string",role:"style"},"Style x86_64");date_values=[];for(d=1;12>=d;d++)month=
     10f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].i386,"color:purple",b[d-1].x86_64,"color:gold"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","gold"],lineWidth:5}}}
     11function build_data_per_month_release_arch(g,e){for(var b=[],d=0;12>d;d++)if(b[d]={"15_i386":0,"15_x86_64":0,"16_i386":0,"16_x86_64":0},g[d])for(var c in g[d])for(var f in g[d][c])for(var a in g[d][c][f])b[d][c+"_"+a]+=g[d][c][f][a];c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 x86");a.addColumn({type:"string",role:"style"},"Style 15 x86");a.addColumn("number","Total 15 x86_64");a.addColumn({type:"string",role:"style"},
     12"Style 15 x86_64");a.addColumn("number","Total 16 x86");a.addColumn({type:"string",role:"style"},"Style 16 x86");a.addColumn("number","Total 16 x86_64");a.addColumn({type:"string",role:"style"},"Style 16 x86_64");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1]["15_i386"],"color:purple",b[d-1]["15_x86_64"],"color:gold",b[d-1]["16_i386"],"color:teal",b[d-1]["16_x86_64"],"color:olive"]),
     13f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","gold","teal","olive"],lineWidth:5}}}
     14function build_data_per_month_flavour_arch(g,e){for(var b=[],d=0;12>d;d++)if(b[d]={client_i386:0,client_x86_64:0,server_i386:0,server_x86_64:0,desktop_i386:0,desktop_x86_64:0,other_i386:0,other_x86_64:0},g[d])for(var c in g[d])for(var f in g[d][c])for(var a in g[d][c][f])b[d][f+"_"+a]+=g[d][c][f][a];c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total client x86");a.addColumn({type:"string",role:"style"},"Style client x86");
    1515a.addColumn("number","Total client x86_64");a.addColumn({type:"string",role:"style"},"Style client x86_64");a.addColumn("number","Total server x86");a.addColumn({type:"string",role:"style"},"Style server x86");a.addColumn("number","Total server x86_64");a.addColumn({type:"string",role:"style"},"Style server x86_64");a.addColumn("number","Total desktop x86");a.addColumn({type:"string",role:"style"},"Style desktop x86");a.addColumn("number","Total desktop x86_64");a.addColumn({type:"string",role:"style"},
    16 "Style desktop x86_64");a.addColumn("number","Total other x86");a.addColumn({type:"string",role:"style"},"Style other x86");a.addColumn("number","Total other x86_64");a.addColumn({type:"string",role:"style"},"Style other x86_64");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].client_i386,"color:goldenrod",b[c-1].client_x86_64,"color:gold",b[c-1].server_i386,"color:darkviolet",b[c-1].server_x86_64,
    17 "color:deeppink",b[c-1].desktop_i386,"color:slateblue",b[c-1].desktop_x86_64,"color:skyblue",b[c-1].other_i386,"color:plum",b[c-1].other_x86_64,"color:pink"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:"goldenrod gold darkviolet deeppink slateblue skyblue plum pink".split(" "),
     16"Style desktop x86_64");a.addColumn("number","Total other x86");a.addColumn({type:"string",role:"style"},"Style other x86");a.addColumn("number","Total other x86_64");a.addColumn({type:"string",role:"style"},"Style other x86_64");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].client_i386,"color:goldenrod",b[d-1].client_x86_64,"color:gold",b[d-1].server_i386,"color:darkviolet",b[d-1].server_x86_64,
     17"color:deeppink",b[d-1].desktop_i386,"color:slateblue",b[d-1].desktop_x86_64,"color:skyblue",b[d-1].other_i386,"color:plum",b[d-1].other_x86_64,"color:pink"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:"goldenrod gold darkviolet deeppink slateblue skyblue plum pink".split(" "),
    1818lineWidth:5}}}
    19 function build_data_per_month_releases_mem(g,e){for(var b=[],c=["2G","4G","8G"],d=0;12>d;d++){b[d]={"15_2G":0,"15_4G":0,"15_8G":0,"16_2G":0,"16_4G":0,"16_8G":0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][a+"_"+c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 < 2G");a.addColumn({type:"string",role:"style"},"Style 15 < 2G");a.addColumn("number","Total 15 < 4G");
    20 a.addColumn({type:"string",role:"style"},"Style 15 < 4G");a.addColumn("number","Total 15 > 4G");a.addColumn({type:"string",role:"style"},"Style 15 > 4G");a.addColumn("number","Total 16 < 2G");a.addColumn({type:"string",role:"style"},"Style 16 < 2G");a.addColumn("number","Total 16 < 4G");a.addColumn({type:"string",role:"style"},"Style 16 < 4G");a.addColumn("number","Total 16 > 4G");a.addColumn({type:"string",role:"style"},"Style 16 > 4G");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),
    21 date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1]["15_2G"],"color:darkgoldenrod",b[d-1]["15_4G"],"color:goldenrod",b[d-1]["15_8G"],"color:gold",b[d-1]["16_2G"],"color:darkviolet",b[d-1]["16_4G"],"color:deeppink",b[d-1]["16_8G"],"color:pink"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},
     19function build_data_per_month_releases_mem(g,e){for(var b=[],d=["2G","4G","8G"],c=0;12>c;c++){b[c]={"15_2G":0,"15_4G":0,"15_8G":0,"16_2G":0,"16_4G":0,"16_8G":0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][a+"_"+d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 < 2G");a.addColumn({type:"string",role:"style"},"Style 15 < 2G");a.addColumn("number","Total 15 < 4G");
     20a.addColumn({type:"string",role:"style"},"Style 15 < 4G");a.addColumn("number","Total 15 > 4G");a.addColumn({type:"string",role:"style"},"Style 15 > 4G");a.addColumn("number","Total 16 < 2G");a.addColumn({type:"string",role:"style"},"Style 16 < 2G");a.addColumn("number","Total 16 < 4G");a.addColumn({type:"string",role:"style"},"Style 16 < 4G");a.addColumn("number","Total 16 > 4G");a.addColumn({type:"string",role:"style"},"Style 16 > 4G");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),
     21date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1]["15_2G"],"color:darkgoldenrod",b[c-1]["15_4G"],"color:goldenrod",b[c-1]["15_8G"],"color:gold",b[c-1]["16_2G"],"color:darkviolet",b[c-1]["16_4G"],"color:deeppink",b[c-1]["16_8G"],"color:pink"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},
    2222chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:"darkgoldenrod goldenrod gold darkviolet deeppink pink".split(" "),lineWidth:5}}}
    23 function build_data_per_month_mem(g,e){for(var b=[],c=["2G","4G","8G"],d=0;12>d;d++){b[d]={"2G":0,"4G":0,"8G":0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total < 2G");a.addColumn({type:"string",role:"style"},"Style < 2G");a.addColumn("number","Total < 4G");a.addColumn({type:"string",role:"style"},"Style < 4G");
    24 a.addColumn("number","Total > 4G");a.addColumn({type:"string",role:"style"},"Style > 4G");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1]["2G"],"color:gold",b[d-1]["4G"],"color:red",b[d-1]["8G"],"color:blue"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",
     23function build_data_per_month_mem(g,e){for(var b=[],d=["2G","4G","8G"],c=0;12>c;c++){b[c]={"2G":0,"4G":0,"8G":0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total < 2G");a.addColumn({type:"string",role:"style"},"Style < 2G");a.addColumn("number","Total < 4G");a.addColumn({type:"string",role:"style"},"Style < 4G");
     24a.addColumn("number","Total > 4G");a.addColumn({type:"string",role:"style"},"Style > 4G");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1]["2G"],"color:gold",b[c-1]["4G"],"color:red",b[c-1]["8G"],"color:blue"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",
    2525viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["gold","red","blue"],lineWidth:5}}}
    26 function build_data_per_month_flavours_mem(g,e){for(var b=[],c=["2G","4G","8G"],d=0;12>d;d++){b[d]={client_2G:0,client_4G:0,client_8G:0,server_2G:0,server_4G:0,server_8G:0,desktop_2G:0,desktop_4G:0,desktop_8G:0,other_2G:0,other_4G:0,other_8G:0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][h+"_"+c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total client < 2G");
     26function build_data_per_month_flavours_mem(g,e){for(var b=[],d=["2G","4G","8G"],c=0;12>c;c++){b[c]={client_2G:0,client_4G:0,client_8G:0,server_2G:0,server_4G:0,server_8G:0,desktop_2G:0,desktop_4G:0,desktop_8G:0,other_2G:0,other_4G:0,other_8G:0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][h+"_"+d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total client < 2G");
    2727a.addColumn({type:"string",role:"style"},"Style client < 2G");a.addColumn("number","Total client < 4G");a.addColumn({type:"string",role:"style"},"Style client < 4G");a.addColumn("number","Total client > 4G");a.addColumn({type:"string",role:"style"},"Style client > 4G");a.addColumn("number","Total server < 2G");a.addColumn({type:"string",role:"style"},"Style server < 2G");a.addColumn("number","Total server < 4G");a.addColumn({type:"string",role:"style"},"Style server < 4G");a.addColumn("number","Total server > 4G");
    2828a.addColumn({type:"string",role:"style"},"Style server > 4G");a.addColumn("number","Total desktop < 2G");a.addColumn({type:"string",role:"style"},"Style desktop < 2G");a.addColumn("number","Total desktop < 4G");a.addColumn({type:"string",role:"style"},"Style desktop < 4G");a.addColumn("number","Total desktop > 4G");a.addColumn({type:"string",role:"style"},"Style desktop > 4G");a.addColumn("number","Total other < 2G");a.addColumn({type:"string",role:"style"},"Style other < 2G");a.addColumn("number",
    29 "Total other < 4G");a.addColumn({type:"string",role:"style"},"Style other < 4G");a.addColumn("number","Total other > 4G");a.addColumn({type:"string",role:"style"},"Style other > 4G");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].client_2G,"color:darkgoldenrod",b[d-1].client_4G,"color:goldenrod",b[d-1].client_8G,"color:gold",b[d-1].server_2G,"color:darkviolet",b[d-1].server_4G,"color:deeppink",
    30 b[d-1].server_8G,"color:pink",b[d-1].desktop_2G,"color:slateblue",b[d-1].desktop_4G,"color:skyblue",b[d-1].desktop_8G,"color:blue",b[d-1].other_2G,"color:teal",b[d-1].other_4G,"color:darkkhaki",b[d-1].other_8G,"color:green"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},
     29"Total other < 4G");a.addColumn({type:"string",role:"style"},"Style other < 4G");a.addColumn("number","Total other > 4G");a.addColumn({type:"string",role:"style"},"Style other > 4G");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].client_2G,"color:darkgoldenrod",b[c-1].client_4G,"color:goldenrod",b[c-1].client_8G,"color:gold",b[c-1].server_2G,"color:darkviolet",b[c-1].server_4G,"color:deeppink",
     30b[c-1].server_8G,"color:pink",b[c-1].desktop_2G,"color:slateblue",b[c-1].desktop_4G,"color:skyblue",b[c-1].desktop_8G,"color:blue",b[c-1].other_2G,"color:teal",b[c-1].other_4G,"color:darkkhaki",b[c-1].other_8G,"color:green"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},
    3131focusTarget:"category",colors:"darkgoldenrod goldenrod gold darkviolet deeppink pink slateblue skyblue blue teal darkkhaki green".split(" "),lineWidth:5}}}
    32 function build_data_per_month_ltsp_usage(g,e){for(var b=[],c=0;24>c;c++){var d=Math.floor(c/2);g[c]&&(b[d]||(b[d]={0:0,1:0}),b[d][parseInt(g[c][0])]=parseInt(g[c][1]))}d=[];var f=new Date,a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total normal clients");a.addColumn({type:"string",role:"style"},"Total normal clients style");a.addColumn("number","Total ltsp clients");a.addColumn({type:"string",role:"style"},"Total ltsp clients style");
    33 date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1][0],"color:purple",b[c-1][1],"color:gold"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",
     32function build_data_per_month_ltsp_usage(g,e){for(var b=[],d=0;24>d;d++){var c=Math.floor(d/2);g[d]&&(b[c]||(b[c]={0:0,1:0}),b[c][parseInt(g[d][0])]=parseInt(g[d][1]))}c=[];var f=new Date,a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total normal clients");a.addColumn({type:"string",role:"style"},"Total normal clients style");a.addColumn("number","Total ltsp clients");a.addColumn({type:"string",role:"style"},"Total ltsp clients style");
     33date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1][0],"color:purple",b[d-1][1],"color:gold"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",
    3434colors:["purple","gold"],lineWidth:5}}}
    35 function build_data_per_month_ltsp_modes(g,e){for(var b=[],c=0;36>c;c++){var d=Math.floor(c/3);g[c]&&(b[d]||(b[d]={thin:0,semi:0,fat:0}),b[d][g[c][0]]=parseInt(g[c][1]))}d=[];var f=new Date,a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total thin clients");a.addColumn({type:"string",role:"style"},"Total thin clients style");a.addColumn("number","Total semi clients");a.addColumn({type:"string",role:"style"},"Total semi clients style");a.addColumn("number",
    36 "Total fat clients");a.addColumn({type:"string",role:"style"},"Total fat clients style");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].thin,"color:purple",b[c-1].semi,"color:gold",b[c-1].fat,"color:olive"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",
     35function build_data_per_month_ltsp_modes(g,e){for(var b=[],d=0;36>d;d++){var c=Math.floor(d/3);g[d]&&(b[c]||(b[c]={thin:0,semi:0,fat:0}),b[c][g[d][0]]=parseInt(g[d][1]))}c=[];var f=new Date,a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total thin clients");a.addColumn({type:"string",role:"style"},"Total thin clients style");a.addColumn("number","Total semi clients");a.addColumn({type:"string",role:"style"},"Total semi clients style");a.addColumn("number",
     36"Total fat clients");a.addColumn({type:"string",role:"style"},"Total fat clients style");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].thin,"color:purple",b[d-1].semi,"color:gold",b[d-1].fat,"color:olive"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",
    3737viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["purple","gold","olive"],lineWidth:5}}}
    38 function build_data_per_month_releases_cpu(g,e){for(var b=[],c=["mono","dualquad","more"],d=0;12>d;d++){b[d]={"15_mono":0,"15_dualquad":0,"15_more":0,"16_mono":0,"16_dualquad":0,"16_more":0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][a+"_"+c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 mono processor");a.addColumn({type:"string",role:"style"},"Style 15 mono processor");
     38function build_data_per_month_releases_cpu(g,e){for(var b=[],d=["mono","dualquad","more"],c=0;12>c;c++){b[c]={"15_mono":0,"15_dualquad":0,"15_more":0,"16_mono":0,"16_dualquad":0,"16_more":0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][a+"_"+d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total 15 mono processor");a.addColumn({type:"string",role:"style"},"Style 15 mono processor");
    3939a.addColumn("number","Total 15 dual or quad processor");a.addColumn({type:"string",role:"style"},"Style 15 dual or quad processor");a.addColumn("number","Total 15 more than quad processor");a.addColumn({type:"string",role:"style"},"Style 15 more than quad processor");a.addColumn("number","Total 16 mono processor");a.addColumn({type:"string",role:"style"},"Style 16 mono processor");a.addColumn("number","Total 16 dual or quad processor");a.addColumn({type:"string",role:"style"},"Style 16 dual or quad processor");
    40 a.addColumn("number","Total 16 more than quad processor");a.addColumn({type:"string",role:"style"},"Style 16 more than quad processor");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1]["15_mono"],"color:darkgoldenrod",b[d-1]["15_dualquad"],"color:goldenrod",b[d-1]["15_more"],"color:gold",b[d-1]["16_mono"],"color:darkviolet",b[d-1]["16_dualquad"],"color:deeppink",b[d-1]["16_more"],"color:pink"]),
    41 f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:"darkgoldenrod goldenrod gold darkviolet deeppink pink".split(" "),lineWidth:5}}}
    42 function build_data_per_month_cpu(g,e){for(var b=[],c=["mono","dualquad","more"],d=0;12>d;d++){b[d]={mono:0,dualquad:0,more:0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total mono processor");a.addColumn({type:"string",role:"style"},"Style mono processor");a.addColumn("number","Total dual or quad processor");a.addColumn({type:"string",
    43 role:"style"},"Style dual or quad processor");a.addColumn("number","Total more than quad processor");a.addColumn({type:"string",role:"style"},"Style more than quad processor");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].mono,"color:gold",b[d-1].dualquad,"color:red",b[d-1].more,"color:blue"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",
    44 isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["gold","red","blue"],lineWidth:5}}}
    45 function build_data_per_month_flavours_cpu(g,e){for(var b=[],c=["mono","dualquad","more"],d=0;12>d;d++){b[d]={client_mono:0,client_dualquad:0,client_more:0,server_mono:0,server_dualquad:0,server_more:0,desktop_mono:0,desktop_dualquad:0,desktop_more:0,other_mono:0,other_dualquad:0,other_more:0};for(var f in c)if(g[c[f]][d])for(var a in g[c[f]][d])for(var h in g[c[f]][d][a])b[d][h+"_"+c[f]]+=g[c[f]][d][a][h]}c=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},
     40a.addColumn("number","Total 16 more than quad processor");a.addColumn({type:"string",role:"style"},"Style 16 more than quad processor");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1]["15_mono"],"color:darkgoldenrod",b[c-1]["15_dualquad"],"color:goldenrod",b[c-1]["15_more"],"color:gold",b[c-1]["16_mono"],"color:darkviolet",b[c-1]["16_dualquad"],"color:deeppink",b[c-1]["16_more"],"color:pink"]),
     41f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:"darkgoldenrod goldenrod gold darkviolet deeppink pink".split(" "),lineWidth:5}}}
     42function build_data_per_month_cpu(g,e){for(var b=[],d=["mono","dualquad","more"],c=0;12>c;c++){b[c]={mono:0,dualquad:0,more:0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},"Date");a.addColumn("number","Total mono processor");a.addColumn({type:"string",role:"style"},"Style mono processor");a.addColumn("number","Total dual or quad processor");a.addColumn({type:"string",
     43role:"style"},"Style dual or quad processor");a.addColumn("number","Total more than quad processor");a.addColumn({type:"string",role:"style"},"Style more than quad processor");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].mono,"color:gold",b[c-1].dualquad,"color:red",b[c-1].more,"color:blue"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",
     44isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",colors:["gold","red","blue"],lineWidth:5}}}
     45function build_data_per_month_flavours_cpu(g,e){for(var b=[],d=["mono","dualquad","more"],c=0;12>c;c++){b[c]={client_mono:0,client_dualquad:0,client_more:0,server_mono:0,server_dualquad:0,server_more:0,desktop_mono:0,desktop_dualquad:0,desktop_more:0,other_mono:0,other_dualquad:0,other_more:0};for(var f in d)if(g[d[f]][c])for(var a in g[d[f]][c])for(var h in g[d[f]][c][a])b[c][h+"_"+d[f]]+=g[d[f]][c][a][h]}d=[];f=new Date;a=new google.visualization.DataTable;a.addColumn({type:"date",role:"domain"},
    4646"Date");a.addColumn("number","Total client mono processor");a.addColumn({type:"string",role:"style"},"Style client mono processor");a.addColumn("number","Total client dual or quad processor");a.addColumn({type:"string",role:"style"},"Style client dual or quad processor");a.addColumn("number","Total client more than quad processor");a.addColumn({type:"string",role:"style"},"Style client more than quad processor");a.addColumn("number","Total server mono processor");a.addColumn({type:"string",role:"style"},
    4747"Style server mono processor");a.addColumn("number","Total server dual or quad processor");a.addColumn({type:"string",role:"style"},"Style server dual or quad processor");a.addColumn("number","Total server more than quad processor");a.addColumn({type:"string",role:"style"},"Style server more than quad processor");a.addColumn("number","Total desktop mono processor");a.addColumn({type:"string",role:"style"},"Style desktop mono processor");a.addColumn("number","Total desktop dual or quad processor");
    4848a.addColumn({type:"string",role:"style"},"Style desktop dual or quad processor");a.addColumn("number","Total desktop more than quad processor");a.addColumn({type:"string",role:"style"},"Style desktop more than quad processor");a.addColumn("number","Total other mono processor");a.addColumn({type:"string",role:"style"},"Style other mono processor");a.addColumn("number","Total other dual or quad processor");a.addColumn({type:"string",role:"style"},"Style other dual or quad processor");a.addColumn("number",
    49 "Total other more than quad processor");a.addColumn({type:"string",role:"style"},"Style other more than quad processor");date_values=[];for(d=1;12>=d;d++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),c.push(date_to_add),date_values.push([date_to_add,b[d-1].client_mono,"color:darkgoldenrod",b[d-1].client_dualquad,"color:goldenrod",b[d-1].client_more,"color:gold",b[d-1].server_mono,"color:darkviolet",b[d-1].server_dualquad,"color:deeppink",b[d-1].server_more,"color:pink",
    50 b[d-1].desktop_mono,"color:slateblue",b[d-1].desktop_dualquad,"color:skyblue",b[d-1].desktop_more,"color:blue",b[d-1].other_mono,"color:teal",b[d-1].other_dualquad,"color:darkkhaki",b[d-1].other_more,"color:green"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:c,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",
     49"Total other more than quad processor");a.addColumn({type:"string",role:"style"},"Style other more than quad processor");date_values=[];for(c=1;12>=c;c++)month=f.getMonth(),year=f.getFullYear(),date_to_add=new Date(year,month),d.push(date_to_add),date_values.push([date_to_add,b[c-1].client_mono,"color:darkgoldenrod",b[c-1].client_dualquad,"color:goldenrod",b[c-1].client_more,"color:gold",b[c-1].server_mono,"color:darkviolet",b[c-1].server_dualquad,"color:deeppink",b[c-1].server_more,"color:pink",
     50b[c-1].desktop_mono,"color:slateblue",b[c-1].desktop_dualquad,"color:skyblue",b[c-1].desktop_more,"color:blue",b[c-1].other_mono,"color:teal",b[c-1].other_dualquad,"color:darkkhaki",b[c-1].other_more,"color:green"]),f.setMonth(month-1);a.addRows(date_values);return{data:a,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:d,format:"MMM"},vAxis:{title:"Num instances",viewWindow:{min:0},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",
    5151colors:"darkgoldenrod goldenrod gold darkviolet deeppink pink slateblue skyblue blue teal darkkhaki green".split(" "),lineWidth:5}}}
    52 function build_data_from_array(g,e){var b=[],c=new Date,d=new google.visualization.DataTable;d.addColumn({type:"date",role:"domain"},"Nhosts");d.addColumn("number",e);date_values=[];for(i=1;12>=i;i++)month=c.getMonth(),year=c.getFullYear(),date_to_add=new Date(year,month),b.push(date_to_add),date_values.push([date_to_add,g[i-1]]),c.setMonth(month-1);d.addRows(date_values);return{data:d,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:b,format:"MMM"},vAxis:{title:"Num hosts",
     52function build_data_from_array(g,e){var b=[],d=new Date,c=new google.visualization.DataTable;c.addColumn({type:"date",role:"domain"},"Nhosts");c.addColumn("number",e);date_values=[];for(i=1;12>=i;i++)month=d.getMonth(),year=d.getFullYear(),date_to_add=new Date(year,month),b.push(date_to_add),date_values.push([date_to_add,g[i-1]]),d.setMonth(month-1);c.addRows(date_values);return{data:c,options:{title:e,curveType:"function",isStacked:!1,hAxis:{title:"Months",ticks:b,format:"MMM"},vAxis:{title:"Num hosts",
    5353minValue:0,maxValue:"automatic",viewWindowMode:"pretty",viewWindow:{min:0,max:"auto"},format:"#"},legend:{textStyle:{fontSize:10}},chartArea:{left:"5%",right:"10%"},focusTarget:"category",lineWidth:5}}}
    54 function doExtendedChart(){end_load_time=get_time();var g=window.location.search.substr(1);""!=g&&(g="?"+g);var e={};start_get_time=get_time();$("#accordion").append('<div id="loading"></div>');$.getJSON("./GetExtendedStats"+g,function(b){start_graph_time=end_get_time=get_time();var c=null,d={machines_per_month:{},clients_per_month:{},freq_updates_per_month:{},change_releases:{},change_flavours:{},count_ltsp:{},count_mode:{},architectures:{},mem:{},cpu:{}};for(key in b){if("clients"==key)for(type in d)if(b[key][type])switch(type){case "machines_per_month":e.clients_per_month||
     54function doExtendedChart(){end_load_time=get_time();var g=window.location.search.substr(1);""!=g&&(g="?"+g);var e={};start_get_time=get_time();$("#accordion").append('<div id="loading"></div>');$.getJSON("./GetExtendedStats"+g,function(b){start_graph_time=end_get_time=get_time();var d=null,c={machines_per_month:{},clients_per_month:{},freq_updates_per_month:{},change_releases:{},change_flavours:{},count_ltsp:{},count_mode:{},architectures:{},mem:{},cpu:{}};for(key in b){if("clients"==key)for(type in c)if(b[key][type])switch(type){case "machines_per_month":e.clients_per_month||
    5555(e.clients_per_month={});e.clients_per_month.hosts||(e.clients_per_month.hosts={});e.clients_per_month.title="Machines";e.clients_per_month.hosts.graph=build_data_from_array(b[key][type],"Number of unique machines used");e.clients_per_month.hosts.title="Number of unique machines used";break;case "clients_per_month":e.clients_per_month||(e.clients_per_month={});e.clients_per_month.releases||(e.clients_per_month.releases={});e.clients_per_month.flavours||(e.clients_per_month.flavours={});e[type].title=
    5656"Machines";e[type].releases.graph=build_data_per_month_releases(b[key][type],"Number instances by release per month");e[type].releases.title="Number instances by release per month";e[type].flavours.graph=build_data_per_month_flavours(b[key][type],"Number instances by flavour per month");e[type].flavours.title="Number instances by flavour per month";break;case "freq_updates_per_month":e[type]={};e[type].title="Updates";e[type].releases={};e[type].releases.graph=build_data_per_month_releases(b[key][type],
     
    6060"Memory");e[type].global.graph=build_data_per_month_mem(b[key][type],"Memory per month");e[type].global.title="Memory distribution per month";e[type].releases.graph=build_data_per_month_releases_mem(b[key][type],"Memory by release per month");e[type].releases.title="Memory distribution by release per month";e[type].flavours.graph=build_data_per_month_flavours_mem(b[key][type],"Memory by flavour per month");e[type].flavours.title="Memory distribution by flavour per month";break;case "cpu":e.cpu||(e.cpu=
    6161{global:{},releases:{},flavours:{}},e.cpu.title="CpuS");e.cpu.global.graph=build_data_per_month_cpu(b[key][type],"Number CpuS per month");e.cpu.global.title="Number CpuS distribution per month";e.cpu.releases.graph=build_data_per_month_releases_cpu(b[key][type],"Number CpuS by release per month");e.cpu.releases.title="Number CpuS distribution by release per month";e.cpu.flavours.graph=build_data_per_month_flavours_cpu(b[key][type],"Number CpuS by release per month");e.cpu.flavours.title="Number CpuS distribution by flavour per month";
    62 break;case "count_ltsp":case "count_mode":e.ltsp||(e.ltsp={},e.ltsp.title="LTSP Usage"),"count_ltsp"!=type||e.ltsp.usage||(e.ltsp.usage={},e.ltsp.usage.graph=build_data_per_month_ltsp_usage(b[key][type],"LTSP usage per month"),e.ltsp.usage.title="LTSP Use"),"count_mode"!=type||e.ltsp.modes||(e.ltsp.modes={},e.ltsp.modes.graph=build_data_per_month_ltsp_modes(b[key][type],"LTSP type by type per month"),e.ltsp.modes.title="Clients LTSP Mode")}if("apps"==key)for(type in b.apps)switch(type){case "app":c=
    63 b.apps[type];break;case "app_use":b[key][type]&&(e[type]={},e[type].title="Application usage",e[type].releases={},e[type].releases.graph=build_data_per_month_releases(b[key][type],"Application use by release per month ("+c+")"),e[type].releases.title="Use per month for application "+c,e[type].flavours={},e[type].flavours.graph=build_data_per_month_flavours(b[key][type],"Application use by flavour per month ("+c+")"),e[type].flavours.title="Use per month for application "+c)}key.startsWith("debug")&&
     62break;case "count_ltsp":case "count_mode":e.ltsp||(e.ltsp={},e.ltsp.title="LTSP Usage"),"count_ltsp"!=type||e.ltsp.usage||(e.ltsp.usage={},e.ltsp.usage.graph=build_data_per_month_ltsp_usage(b[key][type],"LTSP usage per month"),e.ltsp.usage.title="LTSP Use"),"count_mode"!=type||e.ltsp.modes||(e.ltsp.modes={},e.ltsp.modes.graph=build_data_per_month_ltsp_modes(b[key][type],"LTSP type by type per month"),e.ltsp.modes.title="Clients LTSP Mode")}if("apps"==key)for(type in b.apps)switch(type){case "app":d=
     63b.apps[type];break;case "app_use":b[key][type]&&(e[type]={},e[type].title="Application usage",e[type].releases={},e[type].releases.graph=build_data_per_month_releases(b[key][type],"Application use by release per month ("+d+")"),e[type].releases.title="Use per month for application "+d,e[type].flavours={},e[type].flavours.graph=build_data_per_month_flavours(b[key][type],"Application use by flavour per month ("+d+")"),e[type].flavours.title="Use per month for application "+d)}key.startsWith("debug")&&
    6464("debug_query_time"==key&&(query_time=b[key]),"debug_keep_alive"==key&&(keep_alive=b[key]))}for(var f in e)if(e[f].title){$("#accordion").append('<h3 class="'+f+'">'+e[f].title+'</h3><div id="'+f+'"></div>');for(var a in e[f])"title"!=a&&e[f][a].graph&&($("#"+f).append("<div id="+f+"_"+a+"></div>"),b=get_sizes(f),e[f][a].graph.options.width=b.width,e[f][a].graph.options.height=b.height,(new google.visualization.LineChart(document.getElementById(f+"_"+a))).draw(e[f][a].graph.data,e[f][a].graph.options))}$("#loading").remove();
    65 $("#accordion").accordion({active:!1,collapsible:!0});null!=c&&$(".app_use").click();end_graph_time=get_time();print_stats(end_graph_time,query_time)})}
     65$("#accordion").accordion({active:!1,collapsible:!0,heightStyle:"content",autoHeight:!1});null!=d&&$(".app_use").click();end_graph_time=get_time();print_stats(end_graph_time,query_time)})}
    6666function doChart(g){g=void 0===g?"":g;end_load_time=get_time();var e=new google.visualization.DataTable;e.addColumn("string","App");e.addColumn("number","Count");e=new google.visualization.DataTable;e.addColumn("string","App");e.addColumn("number","Count");e=new google.visualization.DataTable;e.addColumn("string","App");e.addColumn("number","Count");start_get_time=get_time();$("#accordion").append('<div id="loading"></div>');console.log(g);""==g?(url="./GetStats",limit=10):(url="./GetLliurexStats",
    6767limit=1E3);$.getJSON(url,function(b){start_graph_time=end_get_time=get_time();count=0;for(key in b)if(!key.startsWith("debug"))for(key2 in b[key])count++;max_graph=3*count;obj=[];for(distro in b)if(distro.startsWith("debug"))"debug_query_time"==distro&&(query_time=b[distro]),"debug_keep_alive"==distro&&(keep_alive=b[distro]);else for(sabor in b[distro])for(titles=["Top apps este mes","Top apps ultimo mes","Top apps penultimo mes"],divname="chart_"+distro+"_"+sabor,$("#accordion").append("<h3>Distro "+
    68 distro+"("+sabor+")</h3>"),$("#accordion").append('<div class="'+divname+'"></h3>'),i=0;3>i;i++){$("div."+divname).append('<div id="'+divname+i+'"></div>');k=0;var c=new google.visualization.DataTable;c.addColumn("string","App");c.addColumn("number","Count");for($.each(b[distro][sabor][i][0],function(b,e){c.addRow([b,parseInt(e)]);k++});10>k;)c.addRow(["",0]),k++;obj.push(c);titles[i]=titles[i]+" (Total clients: "+b[distro][sabor][i][1].nclients+")";drawChart(obj[obj.length-1],titles[i],divname+i,
    69 k)}end_graph_time=get_time();print_stats(end_graph_time,query_time)})}num_ready=0;function ready_charts(){num_ready++;num_ready==max_graph&&($("#accordion>#loading").remove(),$("#accordion").accordion({active:!1,collapsible:!0}))}
     68distro+"("+sabor+")</h3>"),$("#accordion").append('<div class="'+divname+'"></h3>'),i=0;3>i;i++){$("div."+divname).append('<div id="'+divname+i+'"></div>');k=0;var d=new google.visualization.DataTable;d.addColumn("string","App");d.addColumn("number","Count");for($.each(b[distro][sabor][i][0],function(b,e){d.addRow([b,parseInt(e)]);k++});10>k;)d.addRow(["",0]),k++;obj.push(d);titles[i]=titles[i]+" (Total clients: "+b[distro][sabor][i][1].nclients+")";drawChart(obj[obj.length-1],titles[i],divname+i,
     69k)}end_graph_time=get_time();print_stats(end_graph_time,query_time)})}num_ready=0;function ready_charts(){num_ready++;num_ready==max_graph&&($("#accordion>#loading").remove(),$("#accordion").accordion({active:!1,collapsible:!0,heightStyle:"content",autoHeight:!1}))}
    7070function print_stats(g,e){g=void 0===g?0:g;e=void 0===e?0:e;$("#stats_box").append('<span class="stats">Load time: '+((end_load_time-start_load_time)/1E3).toString()+" sec</span>");$("#stats_box").append('<span class="stats">Get time: '+parseFloat((end_get_time-start_get_time)/1E3-e).toFixed(3).toString()+" sec</span>");$("#stats_box").append('<span class="stats">Graph time: '+((g-start_graph_time)/1E3).toString()+" sec</span>");$("#stats_box").append('<span class="stats">Query time: '+parseFloat(e).toFixed(3).toString()+
    7171" sec</span>");$("#stats_box").append('<span class="stats">Updated: '+keep_alive.toString()+"</span>")}function get_time(){return Date.now?Date.now():(new Date).getTime()}var start_graph_time=0,end_graph_time=0,start_load_time=get_time(),end_load_time=0,start_get_time=0,end_get_time=0,query_time="",keep_alive="";
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/whitelist.js

    r6876 r7280  
    5151
    5252function get_items(){
    53     var state = { 'out' : [], 'unk' : [], 'into' : [] }
     53//    var state = { 'out' : [], 'unk' : [], 'into' : [] }
     54    var state = { 'out' : [], 'into' : [] }
    5455    $('#nonwhitelist>select>option').each(function(){state['out'].push($(this).val())})
    55     $('#unknown_state_whitelist>select>option').each(function(){state['unk'].push($(this).val())})
     56//    $('#unknown_state_whitelist>select>option').each(function(){state['unk'].push($(this).val())})
    5657    $('#inwhitelist>select>option').each(function(){state['into'].push($(this).val())})
    5758    return state
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/whitelist_min.js

    r6876 r7280  
    22a.unk[b]+'">'+a.unk[b]+"</option>")}put_triggers()}
    33function move_to(a,b){var d="",c="",e="";"left"==a?(e=$("#nonwhitelist>select>option:selected"),d=$("#nonwhitelist>select")):"center"==a?(e=$("#unknown_state_whitelist>select>option:selected"),d=$("#unknown_state_whitelist>select")):"right"==a&&(e=$("#inwhitelist>select>option:selected"),d=$("#inwhitelist>select"));"left"==b?c=$("#nonwhitelist>select"):"center"==b?c=$("#unknown_state_whitelist>select"):"right"==b&&(c=$("#inwhitelist>select"));if(""==d||""==c||""==e)return!1;c.append(e);e.each(function(){$("this").remove()});
    4 $("#configure_whitelist option:selected").removeAttr("selected")}function get_items(){var a={out:[],unk:[],into:[]};$("#nonwhitelist>select>option").each(function(){a.out.push($(this).val())});$("#unknown_state_whitelist>select>option").each(function(){a.unk.push($(this).val())});$("#inwhitelist>select>option").each(function(){a.into.push($(this).val())});return a}
     4$("#configure_whitelist option:selected").removeAttr("selected")}function get_items(){var a={out:[],into:[]};$("#nonwhitelist>select>option").each(function(){a.out.push($(this).val())});$("#inwhitelist>select>option").each(function(){a.into.push($(this).val())});return a}
    55function send_items(){var a=get_items();$.post("PutWhitelist",{status:JSON.stringify(a)},function(a){a=a.toLowerCase();"ok"==a?alert("Sending succeded"):alert("Sending succeded but result was Nok, "+a)}).fail(function(a){console.log(a);alert("Error sending ajax requests")})}
    66function get_dbitems(){$("#configure_whitelist").hide();$("#send").hide();$("body").append('<div id="loading"></div>');$.getJSON("GetWhitelistItems",function(a){put_elements(a)}).fail(function(a){alert("Can't fetch whitelist data")})}function filter(a){a=$(this).val().trim().toLowerCase();var b=!1;""!=a&&(b=!0);var d=$(this).parent().next().find("option");for(var c=0;c<d.length;c++){var e=!0;b&&(e=d[c].value.toLowerCase().includes(a));e?$(d[c]).show():$(d[c]).hide()}}
Note: See TracChangeset for help on using the changeset viewer.