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 getSince() { 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 setSince(long since) { 032 this.since = since; 033 } 034 035 /** 036 * Return the maximum number of plans to capture. 037 */ 038 public int getMaxCount() { 039 return maxCount; 040 } 041 042 /** 043 * Set the maximum number of plans to capture. 044 */ 045 public void setMaxCount(int maxCount) { 046 this.maxCount = maxCount; 047 } 048 049 /** 050 * Return the maximum amount of time we want to use to capture plans. 051 * <p> 052 * Query plan collection will stop once this time is exceeded. 053 */ 054 public long getMaxTimeMillis() { 055 return maxTimeMillis; 056 } 057 058 /** 059 * Set the maximum amount of time we want to use to capture plans. 060 * <p> 061 * Query plan collection will stop once this time is exceeded. 062 */ 063 public void setMaxTimeMillis(long maxTimeMillis) { 064 this.maxTimeMillis = maxTimeMillis; 065 } 066}