Created
January 9, 2014 04:05
-
-
Save capeterson/8329265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page controller="Thingy"> | |
This blank canvas with our controller applied lets us invoke the remoting methods from the dev console via: | |
<ul> | |
<li><code>Thingy.regularLimits(function(response){console.log('Regular limits are:',response);});</code></li> | |
<li><code>Thingy.readOnlyLimits(function(response){console.log('Regular limits are:',response);});</code></li> | |
</ul> | |
</apex:page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Thingy{ | |
@RemoteAction | |
public static Map<String,Integer> regularLimits(){ | |
return getLimitsData(); | |
} | |
@ReadOnly | |
@RemoteAction | |
public static Map<String,Integer> readOnlyLimits(){ | |
return getLimitsData(); | |
} | |
private static Map<String,Integer> getLimitsData(){ | |
return new Map<String,Integer>{ | |
'getLimitCallouts()' => Limits.getLimitCallouts(), | |
'getLimitCpuTime()' => Limits.getLimitCpuTime(), | |
'getLimitDMLRows()' => Limits.getLimitDMLRows(), | |
'getLimitDMLStatements()' => Limits.getLimitDMLStatements(), | |
'getLimitFutureCalls()' => Limits.getLimitFutureCalls(), | |
'getLimitHeapSize()' => Limits.getLimitHeapSize(), | |
'getLimitQueries()' => Limits.getLimitQueries(), | |
'getLimitQueries()' => Limits.getLimitQueries(), | |
'getLimitQueryRows()' => Limits.getLimitQueryRows(), | |
'getLimitScriptStatements()' => Limits.getLimitScriptStatements(), | |
'getLimitSoslQueries()' => Limits.getLimitSoslQueries() | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment