<commit_before>//----------------------------------------------------------------------
//This code is developed as part of the Java CoG Kit project
//The terms of the license can be found at http://www.cogkit.org/license
//This message may not be removed or altered.
//----------------------------------------------------------------------

/*
 * Created on Aug 10, 2009
 */
package org.globus.cog.abstraction.coaster.service.job.manager;

public interface Metric {

    Metric NULL_METRIC = new NullMetric();

    double blockSize(int slot, int cslots, double tsum);

    /** Seconds? */
    double getSize(Job j);
    
    double getSizeLeft(Job j);

    /** Seconds? */
    double desiredSize(Job j);

    double size(int w, int h);
    
    int width(int msz, int h);
    
    public class NullMetric implements Metric {
        public double blockSize(int slot, int cslots, double tsum) {
            return 0;
        }

        public double desiredSize(Job j) {
            return 0;
        }

        public double getSize(Job j) {
            return 0;
        }
        
        public double getSizeLeft(Job j) {
            return 0;
        }

        public double size(int w, int h) {
            return 0;
        }

        public int width(int msz, int h) {
            return 0;
        }
    }
}<commit_msg>Add comment<commit_after>//----------------------------------------------------------------------
//This code is developed as part of the Java CoG Kit project
//The terms of the license can be found at http://www.cogkit.org/license
//This message may not be removed or altered.
//----------------------------------------------------------------------

/*
 * Created on Aug 10, 2009
 */
package org.globus.cog.abstraction.coaster.service.job.manager;

public interface Metric {

    Metric NULL_METRIC = new NullMetric();

    double blockSize(int slot, int cslots, double tsum);

    /** Seconds? */
    double getSize(Job j);

    double getSizeLeft(Job j);

    /** Seconds? */
    double desiredSize(Job j);

    double size(int w, int h);

    /**
        Given a size estimate and minimum time length, how many
        worker cores should we allocate?
     */
    int width(int msz, int h);

    public class NullMetric implements Metric {
        public double blockSize(int slot, int cslots, double tsum) {
            return 0;
        }

        public double desiredSize(Job j) {
            return 0;
        }

        public double getSize(Job j) {
            return 0;
        }

        public double getSizeLeft(Job j) {
            return 0;
        }

        public double size(int w, int h) {
            return 0;
        }

        public int width(int msz, int h) {
            return 0;
        }
    }
}
{'fraction_non_alphanumeric': 0.1837622326930047, 'fraction_numerical': 0.008698803914461761, 'mean_word_length': 1.391681109185442, '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': '3962476', 'n_tokens_mistral': 774, 'n_tokens_neox': 723, 'n_words': 260}