<commit_before>/*
 * Copyright 2013 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*global Shumway, randomStyle, createEmptyObject*/

/**
 * Frame Rate Monitor
 */
var Timeline = (function () {
  var barColor = "rgba(255,255,255, 0.075)";
  var backgroundColor = "rgb(61, 61, 61)";
  var backgroundColorInfo = "rgba(0,0,0, 0.85)";
  var fpsLineColor = "rgb(255,64,0)";
  var textColor = "#ccc";

  function timeline(canvas) {
    this.depth = 0;
    this.start = 0;
    this.index = 0;
    this.marks = new Shumway.CircularBuffer(Int32Array);
    this.times = new Shumway.CircularBuffer(Float64Array);
    this.frameRate = 12;
    this.maxFrameTime = 1000 * 2 / this.frameRate;
    this.refreshFrequency = 10;
    this.refreshCounter = 0;
    this.count = 0;
    this.kinds = createEmptyObject();
    this.kindCount = 0;
    this.canvas = canvas;
    this.context = canvas.getContext('2d', { original: true });
    this.fillStyles = ["rgb(85, 152, 213)", "#bfd8a7", "#d906d7"];
    window.addEventListener('resize', this.resizeHandler.bind(this), false);
    this.resizeHandler();
  }

  timeline.prototype.setFrameRate = function setFrameRate(frameRate) {
    this.frameRate = frameRate;
    this.maxFrameTime = 1000 * 2 / frameRate;
  };

  timeline.prototype.refreshEvery = function refreshEvery(freq) {
    this.refreshFrequency = freq;
    this.refreshCounter = 0;
  };

  var ENTER = 0xBEEF0000 | 0;
  var LEAVE = 0xDEAD0000 | 0;

  timeline.prototype.registerKind = function getKind(name, fillStyle) {
    if (this.kinds[name] === undefined) {
      this.fillStyles[this.kindCount] = fillStyle;
      this.kinds[name] = this.kindCount++;
    } else {<commit_msg>Make timeline refresh more slowly.<commit_after>/*
 * Copyright 2013 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*global Shumway, randomStyle, createEmptyObject*/

/**
 * Frame Rate Monitor
 */
var Timeline = (function () {
  var barColor = "rgba(255,255,255, 0.075)";
  var backgroundColor = "rgb(61, 61, 61)";
  var backgroundColorInfo = "rgba(0,0,0, 0.85)";
  var fpsLineColor = "rgb(255,64,0)";
  var textColor = "#ccc";

  function timeline(canvas) {
    this.depth = 0;
    this.start = 0;
    this.index = 0;
    this.marks = new Shumway.CircularBuffer(Int32Array);
    this.times = new Shumway.CircularBuffer(Float64Array);
    this.frameRate = 12;
    this.maxFrameTime = 1000 * 2 / this.frameRate;
    this.refreshFrequency = 60;
    this.refreshCounter = 0;
    this.count = 0;
    this.kinds = createEmptyObject();
    this.kindCount = 0;
    this.canvas = canvas;
    this.context = canvas.getContext('2d', { original: true });
    this.fillStyles = ["rgb(85, 152, 213)", "#bfd8a7", "#d906d7"];
    window.addEventListener('resize', this.resizeHandler.bind(this), false);
    this.resizeHandler();
  }

  timeline.prototype.setFrameRate = function setFrameRate(frameRate) {
    this.frameRate = frameRate;
    this.maxFrameTime = 1000 * 2 / frameRate;
  };

  timeline.prototype.refreshEvery = function refreshEvery(freq) {
    this.refreshFrequency = freq;
    this.refreshCounter = 0;
  };

  var ENTER = 0xBEEF0000 | 0;
  var LEAVE = 0xDEAD0000 | 0;

  timeline.prototype.registerKind = function getKind(name, fillStyle) {
    if (this.kinds[name] === undefined) {
      this.fillStyles[this.kindCount] = fillStyle;
      this.kinds[name] = this.kindCount++;
    } else {
{'fraction_non_alphanumeric': 0.12260103860916685, 'fraction_numerical': 0.041092797471212465, 'mean_word_length': 3.5764462809917354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5275557', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1368, 'n_words': 392}