mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-27 03:00:40 -06:00
add some missing extension docs
This commit is contained in:
parent
a8929042f9
commit
b72723b7e5
@ -0,0 +1,9 @@
|
||||
globalvars extension
|
||||
===================
|
||||
|
||||
Allows access to the global object map from SharedState.gl_ObjectMap, which allows
|
||||
for cross-binding and cross-thread data sharing.
|
||||
|
||||
```
|
||||
var result = globalvars.get("result");
|
||||
```
|
@ -0,0 +1,26 @@
|
||||
http extension
|
||||
==============
|
||||
|
||||
Allow access to HTTP URLs from within scripts, supporting both basic
|
||||
get and post methods. In all cases, the returned type is the full
|
||||
response object, from which the body content can be accessed.
|
||||
|
||||
## Examples
|
||||
|
||||
Get content from a URL into a string variable:
|
||||
|
||||
```
|
||||
var response= http.get("http://google.com/")
|
||||
```
|
||||
|
||||
Post an empty body to a URL, useful for state-changing calls where
|
||||
all of the control data is in the URL:
|
||||
|
||||
```
|
||||
var response= http.post("http://some.server/path/to/resource?query=foobarbaz")
|
||||
```
|
||||
|
||||
Post content to a URL, specifying the URL, content value, and content type:
|
||||
```
|
||||
var response= http.post("http://some.server/path/to/resource", "this is the data", "text/plain");
|
||||
```
|
2
nb/src/test/resources/scripts/async/extension_files.js
Normal file
2
nb/src/test/resources/scripts/async/extension_files.js
Normal file
@ -0,0 +1,2 @@
|
||||
// Just an example
|
||||
var content = files.read("somefile.txt");
|
@ -0,0 +1,4 @@
|
||||
// Just an example
|
||||
var result= globalvars.put("result","OK")
|
||||
var result = globalvars.get("result");
|
||||
print("result="+result);
|
1
nb/src/test/resources/scripts/async/extension_http.js
Normal file
1
nb/src/test/resources/scripts/async/extension_http.js
Normal file
@ -0,0 +1 @@
|
||||
var response = http.get("http://example.google.com")
|
3
nb/src/test/resources/scripts/async/extension_s3.js
Normal file
3
nb/src/test/resources/scripts/async/extension_s3.js
Normal file
@ -0,0 +1,3 @@
|
||||
// This requires active credentials, so it is disabled by default.
|
||||
// This still serves as an example
|
||||
// s3.uploadDirToUrl("testdata","s3://nb-extension-test/testdata1");
|
@ -0,0 +1,3 @@
|
||||
shutdown.addShutdownHook('testfunc', function f() {
|
||||
print("shutdown hook running");
|
||||
});
|
Loading…
Reference in New Issue
Block a user