001package io.ebean.meta; 002 003/** 004 * Request used to capture query plans. 005 */ 006public class QueryPlanRequest { 007 008 private long since; 009 010 private int maxCount; 011 012 private long maxTimeMillis; 013 014 /** 015 * Return the epoch time in millis for minimum bind capture time. 016 * <p> 017 * When set this ensures that the bind values used to get the query plan 018 * have been around for a while (e.g. 5 mins) and so reasonably represent 019 * bind values that match the slowest execution for this query plan. 020 */ 021 public long since() { 022 return since; 023 } 024 025 /** 026 * Set the epoch time (e.g. 5 mins ago) such that the query bind values 027 * reasonably represent bind values that match the slowest execution for this query plan. 028 * 029 * @param since The minimum age of the bind values capture. 030 */ 031 public void since(long since) { 032 this.since = since; 033 } 034 035 /** 036 * Return the maximum number of plans to capture. 037 */ 038 public int maxCount() { 039 return maxCount; 040 } 041 042 /** 043 * Set the maximum number of plans to capture. 044 * <p> 045 * Use this to limit how much query plan capturing is done as query 046 * plan capture is actual database load. 047 */ 048 public void maxCount(int maxCount) { 049 this.maxCount = maxCount; 050 } 051 052 /** 053 * Return the maximum amount of time we want to use to capture plans. 054 * <p> 055 * Query plan collection will stop once this time is exceeded. 056 */ 057 public long maxTimeMillis() { 058 return maxTimeMillis; 059 } 060 061 /** 062 * Set the maximum amount of time we want to use to capture plans. 063 * <p> 064 * Query plan collection will stop once this time is exceeded. We use 065 * this to ensure the query plan capture does not use excessive amount 066 * of time - put too much load on the database. 067 */ 068 public void maxTimeMillis(long maxTimeMillis) { 069 this.maxTimeMillis = maxTimeMillis; 070 } 071}