<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-internal) on Fri May 14 16:26:09 CDT 2010 --> <TITLE> QuotaService </TITLE> <META NAME="date" CONTENT="2010-05-14"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="QuotaService"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../../com/google/appengine/api/quota/QuotaService.DataType.html" title="enum in com.google.appengine.api.quota"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/quota/QuotaService.html" target="_top"><B>FRAMES</B></A> <A HREF="QuotaService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.api.quota</FONT> <BR> Interface QuotaService</H2> <HR> <DL> <DT><PRE>public interface <B>QuotaService</B></DL> </PRE> <P> The <code>QuotaService</code> provides a way for user code to get access to some server-internal metrics. <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.DataType.html" title="enum in com.google.appengine.api.quota">QuotaService.DataType</A></B></CODE> <BR> Represents all types of data that a QuotaService might be able to provide.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.html#convertCpuSecondsToMegacycles(double)">convertCpuSecondsToMegacycles</A></B>(double cpuSeconds)</CODE> <BR> Expresses a value in megaCycles as its approximate equivalent of CPU seconds on a theoretical 1.2 GHz CPU.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.html#convertMegacyclesToCpuSeconds(long)">convertMegacyclesToCpuSeconds</A></B>(long megaCycles)</CODE> <BR> Expresses a value in megaCycles as its approximate equivalent of CPU seconds on a theoretical 1.2 GHz CPU.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.html#getApiTimeInMegaCycles()">getApiTimeInMegaCycles</A></B>()</CODE> <BR> Measures the duration that the current request has spent so far in API calls, such as making datastore requests or sending out mail.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.html#getCpuTimeInMegaCycles()">getCpuTimeInMegaCycles</A></B>()</CODE> <BR> Measures the duration that the current request has spent so far processing the request within the App Engine sandbox.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/quota/QuotaService.html#supports(com.google.appengine.api.quota.QuotaService.DataType)">supports</A></B>(<A HREF="../../../../../com/google/appengine/api/quota/QuotaService.DataType.html" title="enum in com.google.appengine.api.quota">QuotaService.DataType</A> type)</CODE> <BR> Tests if the QuotaService can provide a certain kind of data at this point in time.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="supports(com.google.appengine.api.quota.QuotaService.DataType)"><!-- --></A><H3> supports</H3> <PRE> boolean <B>supports</B>(<A HREF="../../../../../com/google/appengine/api/quota/QuotaService.DataType.html" title="enum in com.google.appengine.api.quota">QuotaService.DataType</A> type)</PRE> <DL> <DD>Tests if the QuotaService can provide a certain kind of data at this point in time. Depending on the underlying app server implementation and what state it is in, a QuotaService might not always have access to all categories of data. For example, the dev-appserver might not be able to measure the megacycles of api calls. Trying to access that data would lead to an IllegalStateException, which would then need to be handled. To make it easier to prevent this, it is possible to ask the service if a particular kind of data is supported. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>type</CODE> - the type of data in question. <DT><B>Returns:</B><DD>true if the QuotaService can provide such data at this time. <DT><B>Throws:</B> <DD><CODE>java.lang.NullPointerException</CODE> - if a null argument is passed into the method.</DL> </DD> </DL> <HR> <A NAME="getApiTimeInMegaCycles()"><!-- --></A><H3> getApiTimeInMegaCycles</H3> <PRE> long <B>getApiTimeInMegaCycles</B>()</PRE> <DL> <DD>Measures the duration that the current request has spent so far in API calls, such as making datastore requests or sending out mail. <p> The unit the duration is measured is Megacycles. If all instructions were to be executed sequentially on a standard 1.2 GHz 64-bit x86 CPU, 1200 megacycles would equate to one second physical time elapsed. <P> <DD><DL> <DT><B>Returns:</B><DD>the overall amount spent in API cycles, as returned by the system. Returns 0 if the feature is not supported.</DL> </DD> </DL> <HR> <A NAME="getCpuTimeInMegaCycles()"><!-- --></A><H3> getCpuTimeInMegaCycles</H3> <PRE> long <B>getCpuTimeInMegaCycles</B>()</PRE> <DL> <DD>Measures the duration that the current request has spent so far processing the request within the App Engine sandbox. Note that time spent in API calls will not be added to this value. <p> The unit the duration is measured is Megacycles. If all instructions were to be executed sequentially on a standard 1.2 GHz 64-bit x86 CPU, 1200 megacycles would equate to one second physical time elapsed. <P> <DD><DL> <DT><B>Returns:</B><DD>the overall amount spent in CPU cycles, as returned by the system. Returns 0 if the feature is not supported.</DL> </DD> </DL> <HR> <A NAME="convertMegacyclesToCpuSeconds(long)"><!-- --></A><H3> convertMegacyclesToCpuSeconds</H3> <PRE> double <B>convertMegacyclesToCpuSeconds</B>(long megaCycles)</PRE> <DL> <DD>Expresses a value in megaCycles as its approximate equivalent of CPU seconds on a theoretical 1.2 GHz CPU. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>megaCycles</CODE> - the value, in megacycles, to convert. <DT><B>Returns:</B><DD>a double representing the CPU-seconds the input megacycle value converts to.</DL> </DD> </DL> <HR> <A NAME="convertCpuSecondsToMegacycles(double)"><!-- --></A><H3> convertCpuSecondsToMegacycles</H3> <PRE> long <B>convertCpuSecondsToMegacycles</B>(double cpuSeconds)</PRE> <DL> <DD>Expresses a value in megaCycles as its approximate equivalent of CPU seconds on a theoretical 1.2 GHz CPU. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>cpuSeconds</CODE> - the value, in cpu seconds, to convert. <DT><B>Returns:</B><DD>a long representing the megacycles the input CPU-seconds value converts to.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../../com/google/appengine/api/quota/QuotaService.DataType.html" title="enum in com.google.appengine.api.quota"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/quota/QuotaService.html" target="_top"><B>FRAMES</B></A> <A HREF="QuotaService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>