Changeset 8241


Ignore:
Timestamp:
Nov 13, 2018, 1:45:17 PM (2 years ago)
Author:
mabarracus
Message:

fixes

Location:
lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/graph.css

    r8233 r8241  
    8080    border-color: darkcyan;
    8181}
    82 #query_box>span>select,#query_box>button {
     82#query_box>span>select {
    8383   width: 100px;
    8484}
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/graph_min.js

    r7869 r8241  
    6969"LTSP usage per month"),f.ltsp.usage.title="LTSP Use"),"count_mode"!=a||f.ltsp.modes||(f.ltsp.modes={},f.ltsp.modes.graph=build_data_per_month_ltsp_modes(b[e][a],"LTSP type by type per month"),f.ltsp.modes.title="Clients LTSP Mode")}if("apps"==e)for(var g in b.apps)if(b.apps[g].app&&b.apps[g].app_use){d=b.apps[g].app;var m="usage_"+g;f[m]={};f[m].title="Application usage "+d;f[m].releases={};f[m].releases.graph=build_data_per_month_releases(b[e][g].app_use,"Application use by release per month ("+
    7070d+")");f[m].releases.title="Use per month for application "+d;f[m].flavours={};f[m].flavours.graph=build_data_per_month_flavours(b[e][g].app_use,"Application use by flavour per month ("+d+")");f[m].flavours.title="Use per month for application "+d}e.startsWith("debug")&&("debug_query_time"==e&&(query_time=b[e]),"debug_keep_alive"==e&&(keep_alive=b[e]))}for(var l in f)if(f[l].title){$("#accordion").append('<h3 class="'+l+'">'+f[l].title+'</h3><div id="'+l+'"></div>');for(var n in f[l])"title"!=n&&
    71 f[l][n].graph&&($("#"+l).append("<div id="+l+"_"+n+"></div>"),b=get_sizes(l),f[l][n].graph.options.width=b.width,f[l][n].graph.options.height=b.height,(new google.visualization.LineChart(document.getElementById(l+"_"+n))).draw(f[l][n].graph.data,f[l][n].graph.options))}$("#loading").remove();$("#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)},async:!0})}
    72 function param_to_obj(g){"?"==g.substr(0,1)&&(g=g.substr(1));if(""==g)return"Undefined";var f={};g.split("&").forEach(function(b){b=b.split("=");f[b[0]]=decodeURIComponent(b[1])});return f}
     71f[l][n].graph&&($("#"+l).append("<div id="+l+"_"+n+"></div>"),b=get_sizes(l),f[l][n].graph.options.width=b.width,f[l][n].graph.options.height=b.height,(new google.visualization.LineChart(document.getElementById(l+"_"+n))).draw(f[l][n].graph.data,f[l][n].graph.options))}$("#loading").remove();$("#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);run_css_fixes()},async:!0})}
     72function run_css_fixes(){$("#accordion>div>div:last-child svg").css("height",String(1.1*Number($("#accordion>div>div:last-child svg").css("height").slice(0,-2)))+"px")}function param_to_obj(g){"?"==g.substr(0,1)&&(g=g.substr(1));if(""==g)return"Undefined";var f={};g.split("&").forEach(function(b){b=b.split("=");f[b[0]]=decodeURIComponent(b[1])});return f}
    7373function doChart(g){g=void 0===g?"":g;var f=window.location.search.substr(1),b=3;""!=f&&(f="?"+f,params=param_to_obj(f),params.hasOwnProperty("init")&&params.hasOwnProperty("window")?b=1:f="");end_load_time=get_time();start_get_time=get_time();$("#accordion").append('<div id="loading"></div>');""==g?(url="./GetStats"+f,limit=10):(url="./GetLliurexStats"+f,limit=1E3);$.getJSON(url,function(d){start_graph_time=end_get_time=get_time();count=0;for(key in d)if(!key.startsWith("debug"))for(key2 in d[key])count++;
    7474max_graph=count*b;obj=[];var c,e;for(distro in d)"debug_init_range"==distro&&(c=d[distro]),"debug_end_range"==distro&&(e=d[distro]),"debug_query_time"==distro&&(query_time=d[distro]),"debug_keep_alive"==distro&&(keep_alive=d[distro]);for(distro in d)if(!distro.startsWith("debug"))for(sabor in d[distro])for(titles=1==b?["Top apps from "+c+" until "+e]:["Top apps este mes","Top apps ultimo mes","Top apps penultimo mes"],divname="chart_"+distro+"_"+sabor,$("#accordion").append("<h3>Distro "+distro+"("+
    7575sabor+")</h3>"),$("#accordion").append('<div class="'+divname+'"></h3>'),i=0;i<b;i++){$("div."+divname).append('<div id="'+divname+i+'"></div>');k=0;var a=new google.visualization.DataTable;a.addColumn("string","App");a.addColumn("number","Count");for($.each(d[distro][sabor][i][0],function(b,c){a.addRow([b,parseInt(c)]);k++});10>k;)a.addRow(["",0]),k++;obj.push(a);titles[i]=titles[i]+" (Total clients: "+d[distro][sabor][i][1].nclients+")";drawChart(obj[obj.length-1],titles[i],divname+i,k)}end_graph_time=
    76 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}))}
     76get_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}),run_css_fixes())}
    7777function print_stats(g,f){g=void 0===g?0:g;f=void 0===f?0:f;$("#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-f).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(f).toFixed(3).toString()+
    7878" 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="";
Note: See TracChangeset for help on using the changeset viewer.