<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
  Browse the glideinWMS RRDs over the entries

  Based on
  javascriptrrd/src/lib/rrdJFlot.html 
   Original repository: http://javascriptrrd.sourceforge.net/
-->

<html>
  
    <script type="text/javascript" src="jslibs/binaryXHR.js"></script>
    <script type="text/javascript" src="jslibs/rrdFile.js"></script>
    <script type="text/javascript" src="jslibs/rrdMultiFile.js"></script>

    <!-- rrdFlot class needs the following four include files !-->
    <script type="text/javascript" src="jslibs/rrdFlotSupport.js"></script>
    <script type="text/javascript" src="jslibs/rrdFlotMatrix.js"></script>
    <script type="text/javascript" src="jslibs/jquery.js"></script>
    <script type="text/javascript" src="jslibs/jquery.flot.js"></script>
    <script type="text/javascript" src="jslibs/jquery.flot.selection.js"></script>

    <script type="text/javascript" src="jslibs/factory_support.js"></script>
  <head>
    <title>RRD matrix by gfactory entries</title>
  </head>

  <body>
    <table width="100%">
    <tr>
     <td><h1 id="title">RRD matrix by gfactory entries</h1>
     <td align="right">[ 
	    <a href="factoryStatus.html">Status</a> |
	    <a href="factoryLogStatus.html">Log status</a> |
	    <a href="factoryCompletedStats.html">Completed stats</a> |
	    <a href="factoryRRDBrowse.html">Browse</a> 
	    ]
    </tr>
    </table>

    <table border=0>
     <tr>
       <th>Entries</th>
       <td><form id="entries">
       </form></td>
     </tr>
     <tr>
       <th>RRD</th>
       <td><form id="rrds">
	<input type="radio" name="rrd" value="Status_Attributes" checked>Status_Attributes
	<input type="radio" name="rrd" value="Log_Counts">Log_Counts
	<input type="radio" name="rrd" value="Log_Completed">Log_Completed
       </form></td>
     </tr>
     <tr>
      <td colspan=2><button onclick="fname_update()">Update</button></td>
     </tr>
    </table>

    <hr>

    <table id="infotable" border=1>
        <tr><td colspan="21"><b>Javascript needed for this page to work</b></td></tr>
	<tr><td><b>RRD file</b></td><td id="fname" colspan="5">None</td></tr>
    </table>

    <div id="mygraph"></div>

   <hr>
    <p>Powered by
        <a href="http://oss.oetiker.ch/rrdtool/" target="_blank">RRDTool</a>,
        <a href="https://sourceforge.net/projects/javascriptrrd/" target="_blank">JavascriptRRD</a> and                                                                 <a href="http://code.google.com/p/flot/" target="_blank">Flot</a>.
 
    <script type="text/javascript">

      // Remove the Javascript warning
      document.getElementById("infotable").deleteRow(0);

      // Load the status of the factory
      var factoryQStats=loadFactoryQStats();
      var entries=getFactoryEntryGroups(factoryQStats);
      char_count=0;

      for (var entry in entries) {
  
	var cb_el = document.createElement("input");
	cb_el.type = "checkbox";
	cb_el.name = "entry";
	cb_el.value = entries[entry];
	cb_el.checked = cb_el.defaultChecked = true;

        var html_el=document.getElementById("entries");
        if (char_count>60) {
          html_el.appendChild(document.createElement("br"));
          char_count=0;
        }
        html_el.appendChild(cb_el);
        html_el.appendChild(document.createTextNode(entries[entry]));
        char_count+=1+cb_el.value.length;
       }

     // fname and rrd_data are the global variable used by all the functions below
      rrd_name="";
      entry_names=[];
      fnames=[];
      rrd_data=[];
      rrd_group_data=[];

      // This function updates the Web Page with the data from the RRD archive header
      // when a new file is selected
      function update_fname() {
        // Finally, update the file name and enable the update button
        document.getElementById("fname").firstChild.data=rrd_name;
	var rrd_files=[];
        var num_ent = (rrd_data.length >= rrd_group_data.length) ? rrd_data.length : rrd_group_data.length;
	for (var i=0; i<num_ent; i++) {
           if (rrd_data[i] != null) {
	     rrd_files.push([entry_names[i],rrd_data[i]]);
           } 
           else if (rrd_group_data[i] != null) {
                var rrd_data_sum=new RRDFileSum(rrd_group_data[i], false);
                rrd_files.push([entry_names[i],rrd_data_sum]);
            }
	} 

        // the rrdFlot object creates and handles the graph
        var f=new rrdFlotMatrix("mygraph",rrd_files);
      }

      function update_grouped_fname_handler(bf, idx) {
          document.getElementById("fname").firstChild.data=document.getElementById("fname").firstChild.data+".";

          var i_rrd_data=undefined;
          try {
            var i_rrd_data=new RRDFile(bf);            
          } catch(err) {
            alert("File "+fnames[idx]+" is not a valid RRD archive!");
          }
          if (i_rrd_data!=undefined) {
            if (rrd_group_data[idx]==null) {
              rrd_group_data[idx] = new Array();
            }
            rrd_data[idx] = null;
            rrd_group_data[idx][(rrd_group_data[idx]).length]=i_rrd_data;
          }
	  var all_defined=true;
          for (var i in rrd_group_data) {
            if ((rrd_group_data[idx]==null) && (rrd_data[idx]==null)) {
	       all_defined=false;
	    }
	  } 

          if (all_defined) {
            update_fname()
          }
      }


      function update_fname_handler(bf, idx) {
          document.getElementById("fname").firstChild.data=document.getElementById("fname").firstChild.data+".";

          var i_rrd_data=undefined;
          try {
            var i_rrd_data=new RRDFile(bf);            
          } catch(err) {
            alert("File "+fnames[idx]+" is not a valid RRD archive!");
          }
          if (i_rrd_data!=undefined) {
            rrd_data[idx]=i_rrd_data;
            rrd_group_data[idx] = null;
          }
	  var all_defined=true;
          for (var i in rrd_data) {
            if ((rrd_group_data[idx]==null) && (rrd_data[idx]==null)) {
	       all_defined=false;
	    }
	  } 

          if (all_defined) {
            update_fname()
          }
      }



      // this function is invoked when the RRD file name changes
      function fname_update() {
	fnames=[];
	rrd_data=[];

	entry_names=[];
        rrd_name="";

        var entries_obj=document.getElementById("entries")
        for (var i in entries_obj.entry) {
          var entry=entries_obj.entry[i];
          if (entry.checked==true) {
  	    entry_names.push(entry.value);
          }
        }

        var rrds_obj=document.getElementById("rrds")
        for (var i in rrds_obj.rrd) {
          var rrd=rrds_obj.rrd[i];
          if (rrd.checked==true) {
  	    rrd_name=rrd.value;
          }
        }

        for (var i in entry_names) {
          var ent_list = entry_names[i].split(",");
          var fn_array = new Array();
          for(var j=0; j<ent_list.length; j++) {
            fn_array.push("entry_"+ent_list[j]+"/total/"+rrd_name+".rrd");
          }<commit_msg>Display group names rather than the entries in the group. Sort the entries on the top of the page with entries followed by groups Bug fix where clicking update would not reinitialize the group date and would add to the existing data.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
  Browse the glideinWMS RRDs over the entries

  Based on
  javascriptrrd/src/lib/rrdJFlot.html 
   Original repository: http://javascriptrrd.sourceforge.net/
-->

<html>
  
    <script type="text/javascript" src="jslibs/binaryXHR.js"></script>
    <script type="text/javascript" src="jslibs/rrdFile.js"></script>
    <script type="text/javascript" src="jslibs/rrdMultiFile.js"></script>

    <!-- rrdFlot class needs the following four include files !-->
    <script type="text/javascript" src="jslibs/rrdFlotSupport.js"></script>
    <script type="text/javascript" src="jslibs/rrdFlotMatrix.js"></script>
    <script type="text/javascript" src="jslibs/jquery.js"></script>
    <script type="text/javascript" src="jslibs/jquery.flot.js"></script>
    <script type="text/javascript" src="jslibs/jquery.flot.selection.js"></script>

    <script type="text/javascript" src="jslibs/factory_support.js"></script>
  <head>
    <title>RRD matrix by gfactory entries</title>
  </head>

  <body>
    <table width="100%">
    <tr>
     <td><h1 id="title">RRD matrix by gfactory entries</h1>
     <td align="right">[ 
	    <a href="factoryStatus.html">Status</a> |
	    <a href="factoryLogStatus.html">Log status</a> |
	    <a href="factoryCompletedStats.html">Completed stats</a> |
	    <a href="factoryRRDBrowse.html">Browse</a> 
	    ]
    </tr>
    </table>

    <table border=0>
     <tr>
       <th>Entries/Groups</th>
       <td><form id="entries">
       </form></td>
     </tr>
     <tr>
       <th>RRD</th>
       <td><form id="rrds">
	<input type="radio" name="rrd" value="Status_Attributes" checked>Status_Attributes
	<input type="radio" name="rrd" value="Log_Counts">Log_Counts
	<input type="radio" name="rrd" value="Log_Completed">Log_Completed
       </form></td>
     </tr>
     <tr>
      <td colspan=2><button onclick="fname_update()">Update</button></td>
     </tr>
    </table>

    <hr>

    <table id="infotable" border=1>
        <tr><td colspan="21"><b>Javascript needed for this page to work</b></td></tr>
	<tr><td><b>RRD file</b></td><td id="fname" colspan="5">None</td></tr>
    </table>

    <div id="mygraph"></div>

   <hr>
    <p>Powered by
        <a href="http://oss.oetiker.ch/rrdtool/" target="_blank">RRDTool</a>,
        <a href="https://sourceforge.net/projects/javascriptrrd/" target="_blank">JavascriptRRD</a> and                                                                 <a href="http://code.google.com/p/flot/" target="_blank">Flot</a>.
 
    <script type="text/javascript">

      // Remove the Javascript warning
      document.getElementById("infotable").deleteRow(0);

      // Load the status of the factory
      var factoryQStats=loadFactoryQStats();
      var entries=getFactoryEntryGroups(factoryQStats);
      group_map = entries;
      char_count=0;
      var groups_starting_idx = 0;
      var entries_processed = 0;

      var ordered_entries_groups = [];
      for(entry in entries) {
          var e = (entries[entry]).toString();
          if ((e.split(",")).length == 1) {
              ordered_entries_groups[entry] = entries[entry];
              groups_starting_idx++;
          }
      }
      for(entry in entries) {
          var e = (entries[entry]).toString();
          if ((e.split(",")).length > 1) {
              ordered_entries_groups[entry] = entries[entry];
          }
      }      
      entries = ordered_entries_groups;

      // First get all the entries and later do the same thing for groups
      //for (var entry in entries) {
      for (var entry in ordered_entries_groups) {
	  var cb_el = document.createElement("input");
	  cb_el.type = "checkbox";
	  cb_el.name = "entry";
	  cb_el.value = entries[entry];
	  cb_el.checked = cb_el.defaultChecked = true;
          var html_el=document.getElementById("entries");
          if( (entries_processed > 0) && 
              (entries_processed==groups_starting_idx) ){
              html_el.appendChild(document.createElement("hr"));
              char_count=0;
          }
          if (char_count>60) {
              html_el.appendChild(document.createElement("br"));
              char_count=0;
          }
          html_el.appendChild(cb_el);
          //html_el.appendChild(document.createTextNode(entries[entry]));
          html_el.appendChild(document.createTextNode(entry));
          char_count+=1+cb_el.value.length;
          entries_processed++;
      }

      function entrylist2groupname(elist) {
          var gname = elist;
          for(var g in group_map) {
              if (group_map[g] == elist) {
                  gname = g;
                  break;
              }
          }
          return gname;
      }

     // fname and rrd_data are the global variable used by all the functions below
      rrd_name="";
      entry_names=[];
      fnames=[];
      rrd_data=[];
      rrd_group_data=[];

      // This function updates the Web Page with the data from the RRD archive header
      // when a new file is selected
      function update_fname() {
        // Finally, update the file name and enable the update button
        document.getElementById("fname").firstChild.data=rrd_name;
	var rrd_files=[];
        var num_ent = (rrd_data.length >= rrd_group_data.length) ? rrd_data.length : rrd_group_data.length;
	for (var i=0; i<num_ent; i++) {
           if ((rrd_data[i] != null) && (entry_names[i] != undefined)){
	     rrd_files.push([entry_names[i],rrd_data[i]]);
           } 
           else if ((rrd_group_data[i] != null) &&(entry_names[i] != undefined)){
                var rrd_data_sum=new RRDFileSum(rrd_group_data[i], false);
                //rrd_files.push([entry_names[i],rrd_data_sum]);
                rrd_files.push([entrylist2groupname(entry_names[i]),rrd_data_sum]);
            }
	} 

        // the rrdFlot object creates and handles the graph
        var f=new rrdFlotMatrix("mygraph",rrd_files);
      }

      function update_grouped_fname_handler(bf, idx) {
          document.getElementById("fname").firstChild.data=document.getElementById("fname").firstChild.data+".";

          var i_rrd_data=undefined;
          try {
            i_rrd_data=new RRDFile(bf);            
          } catch(err) {
            alert("File "+fnames[idx]+" is not a valid RRD archive!");
          }
          if (i_rrd_data!=undefined) {
            if (rrd_group_data[idx]==null) {
              rrd_group_data[idx] = new Array();
            }
            rrd_data[idx] = null;
            rrd_group_data[idx][(rrd_group_data[idx]).length]=i_rrd_data;
          }
	  var all_defined=true;
          for (var i in rrd_group_data) {
            if ((rrd_group_data[idx]==null) && (rrd_data[idx]==null)) {
	       all_defined=false;
	    }
	  } 

          if (all_defined) {
            update_fname()
          }
      }


      function update_fname_handler(bf, idx) {
          document.getElementById("fname").firstChild.data=document.getElementById("fname").firstChild.data+".";

          var i_rrd_data=undefined;
          try {
            var i_rrd_data=new RRDFile(bf);            
          } catch(err) {
            alert("File "+fnames[idx]+" is not a valid RRD archive!");
          }
          if (i_rrd_data!=undefined) {
            rrd_data[idx]=i_rrd_data;
            rrd_group_data[idx] = null;
          }
	  var all_defined=true;
          for (var i in rrd_data) {
            if ((rrd_group_data[idx]==null) && (rrd_data[idx]==null)) {
	       all_defined=false;
	    }
	  } 

          if (all_defined) {
            update_fname()
          }
      }



      // this function is invoked when the RRD file name changes
      function fname_update() {
 
	fnames=[];
	rrd_data=[];
        rrd_group_data=[];
	entry_names=[];
        rrd_name="";

        var entries_obj=document.getElementById("entries")
        for (var i in entries_obj.entry) {
          var entry=entries_obj.entry[i];
          if (entry.checked==true) {
  	    entry_names.push(entry.value);
          }
        }

        var rrds_obj=document.getElementById("rrds")
        for (var i in rrds_obj.rrd) {
          var rrd=rrds_obj.rrd[i];
          if (rrd.checked==true) {
  	    rrd_name=rrd.value;
          }
        }

        for (var i in entry_names) {
          var ent_list = entry_names[i].split(",");
          var fn_array = new Array();
          for(var j=0; j<ent_list.length; j++) {
            fn_array.push("entry_"+ent_list[j]+"/total/"+rrd_name+".rrd");
          }
{'fraction_non_alphanumeric': 0.1434265468809313, 'fraction_numerical': 0.0034164241427306085, 'mean_word_length': 2.3617609527860486, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 205, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1680672', 'n_tokens_mistral': 5264, 'n_tokens_neox': 5074, 'n_words': 968}