<commit_before>/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global window, Backbone */
(function() {
  "use strict";

  window.ClusterPlan = Backbone.Model.extend({

    defaults: {
    },

    url: "cluster/plan",

    idAttribute: "config",

    getCoordinator: function() {
      if (this._coord) {
        return this._coord;
      }
      var i,j,r;
      r = this.get("runInfo");
      j = r.length-1;
      while (j > 0) {
        if(r[j].isStartServers) {
          var l = r[j];
          if (l.endpoints) {
            for (i = 0; i < l.endpoints.length;i++) {
              if (l.roles[i] === "Coordinator") {
                this._coord = l.endpoints[i]
                  .replace("tcp://","http://")
                  .replace("ssl://", "https://");
                return this._coord;
              }
            }
          }
        }
        j--;
      }
    },

    isAlive : function() {
      var result = false;
      $.ajax({
        cache: false,
        type: "GET",
        async: false, // sequential calls!
        url: "cluster/healthcheck",
        success: function(data) {
          result = data;
        },
        error: function(data) {
        }
      });
      return result;
    },

    isSymmetricSetup: function() {
      var count = _.size(this.get("config").dispatchers);
      return count === config.numberOfCoordinators
        && count === config.numberOfDBservers;
    },

    isTestSetup: function() {
      return _.size(this.get("config").dispatchers);
    }
<commit_msg>Fixed a check in the clusterPlan, a plan is now propoerly identified as test, symmetric or asymmetric<commit_after>/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global window, Backbone */
(function() {
  "use strict";

  window.ClusterPlan = Backbone.Model.extend({

    defaults: {
    },

    url: "cluster/plan",

    idAttribute: "config",

    getCoordinator: function() {
      if (this._coord) {
        return this._coord;
      }
      var i,j,r;
      r = this.get("runInfo");
      j = r.length-1;
      while (j > 0) {
        if(r[j].isStartServers) {
          var l = r[j];
          if (l.endpoints) {
            for (i = 0; i < l.endpoints.length;i++) {
              if (l.roles[i] === "Coordinator") {
                this._coord = l.endpoints[i]
                  .replace("tcp://","http://")
                  .replace("ssl://", "https://");
                return this._coord;
              }
            }
          }
        }
        j--;
      }
    },

    isAlive : function() {
      var result = false;
      $.ajax({
        cache: false,
        type: "GET",
        async: false, // sequential calls!
        url: "cluster/healthcheck",
        success: function(data) {
          result = data;
        },
        error: function(data) {
        }
      });
      return result;
    },

    isSymmetricSetup: function() {
      var config = this.get("config");
      var count = _.size(config.dispatchers);
      return count === config.numberOfCoordinators
        && count === config.numberOfDBservers;
    },

    isTestSetup: function() {
      return _.size(this.get("config").dispatchers) === 1;
    }

{'fraction_non_alphanumeric': 0.15453149001536098, 'fraction_numerical': 0.004608294930875576, 'mean_word_length': 1.645004061738424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315153', 'n_tokens_mistral': 1025, 'n_tokens_neox': 990, 'n_words': 222}