001package io.ebean;
002
003/**
004 * A location for profiling transactions and queries.
005 * <p>
006 * Typically represents a class method in the form of class file and line of code that started
007 * the transaction or invoked the query.
008 * </p>
009 */
010public interface ProfileLocation {
011
012  /**
013   * Create and return a new ProfileLocation.
014   */
015  static ProfileLocation create() {
016    return XServiceProvider.profileLocationFactory().create();
017  }
018
019  /**
020   * Create and return a new ProfileLocation with a given lineNumber and label.
021   */
022  static ProfileLocation create(int lineNumber, String label) {
023    return XServiceProvider.profileLocationFactory().create(lineNumber, label);
024  }
025
026  /**
027   * Create and return a new ProfileLocation with a given location.
028   */
029  static ProfileLocation createAt(String location) {
030    return XServiceProvider.profileLocationFactory().createAt(location);
031  }
032
033  /**
034   * Obtain the location description.
035   */
036  String obtain();
037
038  /**
039   * Return a short version of the location description.
040   */
041  String shortDescription();
042
043  /**
044   * Add execution time.
045   */
046  void add(long executionTime);
047}