<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.karamel.backend.kandy;

import java.io.IOException;
import org.junit.Test;
import se.kth.karamel.backend.stats.ClusterStats;
import se.kth.karamel.backend.stats.PhaseStat;
import se.kth.karamel.backend.stats.TaskStat;
import se.kth.karamel.common.IoUtils;
import se.kth.karamel.common.Settings;

/**
 *
 * @author kamal
 */
public class KandyRestClientTest {

  @Test
  public void testPushStats() throws IOException {
    ClusterStats stats = new ClusterStats();
    String yml = IoUtils.readContentFromClasspath("se/kth/karamel/client/model/test-definitions/flink.yml");
    stats.setDefinition(yml);
    stats.setUserId("kamal-mac");
    PhaseStat phase = new PhaseStat("PRECLEANING", "SUCCEED", 10 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("FORKING GROUPS", "SUCCEED", 7 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("FORKING MACHINES", "SUCCEED", 20 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("INSTALLING", "SUCCEED", 10 * 60 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("EXPERIMENTING", "SUCCEED", 100 * 60 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    TaskStat task = new TaskStat("test-task1", "test-machine1", "succeed", 5 * Settings.SEC_IN_MS);
    stats.addTask(task);
    task = new TaskStat("test-task2", "test-machine2", "succeed", 6 * Settings.SEC_IN_MS);
    stats.addTask(task);
    KandyRestClient.pushClusterStats(stats);
    task = new TaskStat("test-task3", "test-machine3", "succeed", 6 * Settings.SEC_IN_MS);
    stats.addTask(task);
    KandyRestClient.pushClusterStats(stats);
  }
}
<commit_msg>ignored the kandy test, it messes up our statistics<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.karamel.backend.kandy;

import java.io.IOException;
import org.junit.Test;
import se.kth.karamel.backend.stats.ClusterStats;
import se.kth.karamel.backend.stats.PhaseStat;
import se.kth.karamel.backend.stats.TaskStat;
import se.kth.karamel.common.IoUtils;
import se.kth.karamel.common.Settings;

/**
 *
 * @author kamal
 */
public class KandyRestClientTest {

//  @Test
  public void testPushStats() throws IOException {
    ClusterStats stats = new ClusterStats();
    String yml = IoUtils.readContentFromClasspath("se/kth/karamel/client/model/test-definitions/flink.yml");
    stats.setDefinition(yml);
    stats.setUserId("kamal-mac");
    PhaseStat phase = new PhaseStat("PRECLEANING", "SUCCEED", 10 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("FORKING GROUPS", "SUCCEED", 7 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("FORKING MACHINES", "SUCCEED", 20 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("INSTALLING", "SUCCEED", 10 * 60 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    phase = new PhaseStat("EXPERIMENTING", "SUCCEED", 100 * 60 * Settings.SEC_IN_MS);
    stats.addPhase(phase);
    TaskStat task = new TaskStat("test-task1", "test-machine1", "succeed", 5 * Settings.SEC_IN_MS);
    stats.addTask(task);
    task = new TaskStat("test-task2", "test-machine2", "succeed", 6 * Settings.SEC_IN_MS);
    stats.addTask(task);
    KandyRestClient.pushClusterStats(stats);
    task = new TaskStat("test-task3", "test-machine3", "succeed", 6 * Settings.SEC_IN_MS);
    stats.addTask(task);
    KandyRestClient.pushClusterStats(stats);
  }
}

{'fraction_non_alphanumeric': 0.1340560549973559, 'fraction_numerical': 0.012162876784769964, 'mean_word_length': 4.474674384949349, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3113075', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1270, 'n_words': 268}