<commit_before>namespace "Bixby.view.monitoring", (exports, top) ->

  class exports.MetricList extends Stark.View
    el: "div.monitoring_content"
    template: "monitoring/resource_list"
    events: {
    }

    links: {

      # add resources/checks
      ".add_resource_link": [ "mon_hosts_resources_new", (el) ->
        return { host: @host }
        ]

      # add triggers on resources
      ".add_trigger_link": [ "mon_hosts_triggers_new", (el) ->
        return { host: @host, metrics: @metrics, checks: @checks }
        ]

      # metric detail page
      "div.metric a.metric": [ "mon_hosts_resources_metric", (el) ->
          check = @checks.get $(el).attr("check_id")
          metric = @metrics.get $(el).attr("metric_id")
          return { host: @host, check: check, metric: metric }
        ]
    }

    render: ->
      super()

      # render graphs into placeholder divs
      @metrics.each (metric) ->
        s = ".check[check_id=" + metric.get("check_id") + "] .metric[metric_id='" + metric.id + "']"
        Bixby.monitoring.render_metric(s, metric)

      @<commit_msg>disable zooming on list view; sync panning across graphs<commit_after>namespace "Bixby.view.monitoring", (exports, top) ->

  class exports.MetricList extends Stark.View
    el: "div.monitoring_content"
    template: "monitoring/resource_list"
    events: {
    }

    links: {

      # add resources/checks
      ".add_resource_link": [ "mon_hosts_resources_new", (el) ->
        return { host: @host }
        ]

      # add triggers on resources
      ".add_trigger_link": [ "mon_hosts_triggers_new", (el) ->
        return { host: @host, metrics: @metrics, checks: @checks }
        ]

      # metric detail page
      "div.metric a.metric": [ "mon_hosts_resources_metric", (el) ->
          check = @checks.get $(el).attr("check_id")
          metric = @metrics.get $(el).attr("metric_id")
          return { host: @host, check: check, metric: metric }
        ]
    }

    render: ->
      super()

      # render graphs into placeholder divs
      metrics = @metrics
      blockRedraw = false # used to block our drawCallback when synchronizing

      metrics.each (metric) ->
        s = ".check[check_id=" + metric.get("check_id") + "] .metric[metric_id='" + metric.id + "']"
        metric.graph = Bixby.monitoring.render_metric(s, metric)
        metric.graph._bixby_mode = "pan" # on panning in list view, no zoom

        # sync panning all graphs on page
        metric.graph.updateOptions({
          drawCallback: (g, isInitial) ->
            return if isInitial || blockRedraw
            blockRedraw = true
            range = g.xAxisRange();
            metrics.each (m) ->
              if m.graph && m.graph != g
                m.graph.updateOptions({
                  dateWindow: range,
                })
            blockRedraw = false
          })

      @
{'fraction_non_alphanumeric': 0.13120444290177022, 'fraction_numerical': 0.0, 'mean_word_length': 2.1705170517051706, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '2141213', 'n_tokens_mistral': 892, 'n_tokens_neox': 854, 'n_words': 202}