mirror of https://gitee.com/bigwinds/arangodb
130 lines
6.3 KiB
HTML
130 lines
6.3 KiB
HTML
<html><head><title>ArangoDB Manual</title> <style media="screen" type="text/css" style="display:none">body{background-color:white;font:13px Helvetica,arial,freesans,clean,sans-serif;line-height:1.4;color:#333;}#access{font-size:16px;margin-left:12px;display:block;margin-left:10px;margin-right:10px;background-color:#F3F1EE!important;}#access a{border-right:1px solid #DBDEDF;color:#A49F96;display:block;line-height:38px;padding:0 10px;text-decoration:none;}#navigation ul{text-transform:uppercase;list-style:none;margin:0;}#navigation li{float:left;position:relative;}#container{width:920px;margin:0 auto;}a{color:#4183C4;text-decoration:none;}.contents h2{font-size:24px;border-bottom:1px solid #CCC;color:black;}.contents h1{font-size:33px;border-bottom:1px solid #CCC;color:black;}.clearfix:after{content:".";display:block;clear:both;font-size:0;height:0;visibility:hidden;}/**/ *:first-child+html .clearfix{min-height:0;}/**/ * html .clearfix{height:1%;}</style></head><body><div id="container"><img src="images/logo_arangodb.png" width="397" height="67" alt="ArangoDB"><div id="access" role="navigation"><div id="navigation"><ul id="menu-ahome" class="menu"><li><a href="Home.html">Table of contents</a></li> <li><a href="http://www.arangodb.org">ArangoDB homepage</a></li></ul></div><div class="clearfix"></div></div><div>
|
|
<!-- Generated by Doxygen 1.7.5.1 -->
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<h1>Module "internal" </h1> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<div class="textblock"><p>The following functions are used internally.</p>
|
|
<hr/>
|
|
<ol>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalExecute">internal.execute</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalLoad">internal.load</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalLog">internal.log</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalLogLevel">internal.logLevel</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalOutput">internal.output</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalProcessStat">internal.processStat</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalRead">internal.read</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalSPrintF">internal.sprintf</a> </li>
|
|
<li>
|
|
<a class="el" href="JSModuleInternal.html#JSModuleInternalTime">internal.time</a> </li>
|
|
</ol>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalExecute"></a> <hr/>
|
|
<code><b>internal.execute(<em>script</em>, <em>sandbox</em>, <em>filename</em>)</b></code><hr/>
|
|
Executes the <em>script</em> with the <em>sandbox</em> as context. Global variables assigned inside the <em>script</em>, will be visible in the <em>sandbox</em> object after execution. The <em>filename</em> is used for displaying error messages.</p>
|
|
<p>If <em>sandbox</em> is undefined, then <code>execute</code> uses the current context. </p>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalLoad"></a> <hr/>
|
|
<code><b>internal.load(<em>filename</em>)</b></code><hr/>
|
|
Reads in a files and executes the contents in the current context. </p>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalLog"></a> <hr/>
|
|
<code><b>internal.log(<em>level</em>, <em>message</em>)</b></code><hr/>
|
|
Logs the <em>message</em> at the given log <em>level</em>.</p>
|
|
<p>Valid log-level are:</p>
|
|
<ul>
|
|
<li>fatal</li>
|
|
<li>error</li>
|
|
<li>warning</li>
|
|
<li>info</li>
|
|
<li>debug</li>
|
|
<li>trace </li>
|
|
</ul>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalLogLevel"></a> <hr/>
|
|
<code><b>internal.logLevel()</b></code><hr/>
|
|
Returns the current log-level as string.</p>
|
|
<div class="fragment"><pre class="fragment">arango> logLevel();
|
|
"info"
|
|
</pre></div><hr/>
|
|
<code><b>internal.logLevel(<em>level</em>)</b></code><hr/>
|
|
Changes the current log-level. Valid log-level are:</p>
|
|
<ul>
|
|
<li>fatal</li>
|
|
<li>error</li>
|
|
<li>warning</li>
|
|
<li>info</li>
|
|
<li>debug</li>
|
|
<li>trace</li>
|
|
</ul>
|
|
<div class="fragment"><pre class="fragment">arango> logLevel("debug");
|
|
"debug"
|
|
</pre></div> <hr/>
|
|
<p><a class="anchor" id="JSModuleInternalOutput"></a> <hr/>
|
|
<code><b>internal.output(<em>string1</em>, <em>string2</em>, <em>string3</em>, ...)</b></code><hr/>
|
|
Outputs the arguments to standard output.</p>
|
|
<div class="fragment"><pre class="fragment">arango> output("Hallo", " ", "World", "\n");
|
|
Hallo World
|
|
</pre></div> <hr/>
|
|
<p><a class="anchor" id="JSModuleInternalProcessStat"></a> <hr/>
|
|
<code><b>internal.processStat()</b></code><hr/>
|
|
Returns information about the current process:</p>
|
|
<ul>
|
|
<li>minorPageFaults: The number of minor faults the process has made which have not required loading a memory page from disk.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>majorPageFaults: The number of major faults the process has made which have required loading a memory page from disk.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>userTime: Amount of time that this process has been scheduled in user mode, measured in clock ticks.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>systemTime: Amount of time that this process has been scheduled in kernel mode, measured in clock ticks.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>numberThreads: Number of threads in this process.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>residentSize: Resident Set Size: number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>virtualSize: Virtual memory size in bytes.</li>
|
|
</ul>
|
|
<div class="fragment"><pre class="fragment">arango> require("internal").processStat();
|
|
{ minorPageFaults : 2683,
|
|
majorPageFaults : 0,
|
|
userTime : 26,
|
|
systemTime : 7,
|
|
numberThreads : 4,
|
|
residentSize : 2288,
|
|
virtualSize : 55861248 }
|
|
</pre></div> <hr/>
|
|
<p><a class="anchor" id="JSModuleInternalRead"></a> <hr/>
|
|
<code><b>internal.read(<em>filename</em>)</b></code><hr/>
|
|
Reads in a file and returns the content as string. </p>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalSPrintF"></a> <hr/>
|
|
<code><b>internal.sprintf(<em>format</em>, <em>argument1</em>, ...)</b></code><hr/>
|
|
Formats the arguments according to the format string <em>format</em>. </p>
|
|
<hr/>
|
|
<p><a class="anchor" id="JSModuleInternalTime"></a> <hr/>
|
|
<code><b>internal.time()</b></code><hr/>
|
|
Returns the current time in seconds.</p>
|
|
<div class="fragment"><pre class="fragment">arango> time();
|
|
1320574890.733971
|
|
|
|
arango> time();
|
|
1320574901.318164
|
|
</pre></div> </div></div>
|
|
</div></body></html>
|