Socket
Socket
Sign inDemoInstall

aerospike

Package Overview
Dependencies
Maintainers
2
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aerospike - npm Package Compare versions

Comparing version 1.0.51 to 1.0.52

aerospike-1.0.52.tgz

25

benchmarks/config.json

@@ -42,27 +42,2 @@ {

],
"indexSpec" : [
{
"name":"ind1",
"bin":"bin1",
"type": "NUMERIC"
}
],
"querySpec" : [
{
"bin":"bin1",
"btype":"NUMERIC",
"qtype":"Range",
"min" : 0,
"max" : 100000
}
],
"scanSpec" : [
{
"select": [
"bin1",
"bin3"
],
"concurrent":true
}
],
"summary" : true,

@@ -69,0 +44,0 @@ "help" : "Please follow the README.md to specify configurations to run this benchmark"

78

benchmarks/README.md

@@ -14,41 +14,75 @@ # Benchmarks

## Programs
## Running the main benchmark.
The following are the programs in this directory:
- `main.js` – The main benchmark program, which runs multiple batches of operations
against an Aerospike cluster. The program can run for a specified number of iterations
or time frame.
- `inspect.js` – Runs `main.js` with multiple configurations to find a combination
of parameters which appear to perform best.
- `memory.js` – Is a program which is used to process the memory usage output from `main.js`,
to give more insight into memory utilization.
or time frame. To run the benchmark
These programs optionally take a hostname, port, and namespace of the
cluster. The default server is on 127.0.0.1 at port 3000
(a local server installation).
$`node main.js`
Each of the programs will provide usage information when `--help` option is provided.
The configuration parameters to run benchmark are specified through `config.json` file. A sample `config.json`
is available in the benchmark folder. This can be modified to run the desired configuration.
## main.js
## Configuration details.
The primary benchmark program, which will run multiple iterations of a batch of operations against an Aerospike database cluster.
- host : Aerospike host node.(default `localhost`)
- port : The port to connect to Aerospike Server. (default `3000`).
- namespace : All the operations for benchmark are done on this namespace.(default `test`).
- set : The set name on which all the benchmark operations are performed.(default `demo`).
- user : Username to connect to secured cluster. (default `null`).
- password : Password to connect to secured cluster. (default `null`).
- timeout : Global timeout for all read/write operations performed in benchmark. (default `0` - infinite timeout).
- ttl : Time to live for the objects written during benchmark run. (default `10000` seconds).
- log : Log level of the client module (default INFO).
- operations : Number of operations for a single batch of operations. (default `100`).
- iterations : Number of iterations the benchmark should run. (default `null` - runs indefinitely).
- processes : Number of worker process. These are work horses for the benchmark, that does actual read/write or scan/query operations in a aerospike cluster. (default `4` - Recommened value Number of CPUs/cores in the machine).
- time : Time to run the benchmark. This can be specified in the units of seconds/minutes/hours.
Sample data - 30s/30m/30h. This runs for the benchmark for 30 seconds/30 minutes/ 30 hours respectively.
(default `24h` - runs for 24 hours).
- reads : The read proportion in the read/write ratio. (default `1`).
- writes : The write proportion in the read/write ratio. (default `1`).
- keyrange : Range of key values to be used in benchmark for read/write operations. (default `0-100000`).
- binSpec : Bin specification for write operations in benchmark. This is specified using,
- name : name of the bin.
- type : type of the bin. should be STRING, BYTES or INTEGER.
- size : size of data to be written in each bin. For integer type bins size is 8.
The configuration to run benchmark is specified through a json file. A sample JSON file is available.
## Benchmark output.
Alternatively, you can have the program run for a specified period of time. This will supercede the `-I` option, so the number iterations will depend on the number of iterations that can be executed in the time period.
The benchmark prints the read/write tps in the following format.
- `-T <n>[s|m|h]` – The amount of time to run the program. The value will be the amount of time followed by the unit of time. The units are: `s` (seconds), `m` (minutes) and `h` (hours).
info: Fri Oct 02 2015 00:03:55 GMT+0530 (IST) read(tps=14434 timeouts=0 errors=0) write(tps=14350 timeouts=0 errors=0)
Use `--help` to list all options for the program.
info: Fri Oct 02 2015 00:03:56 GMT+0530 (IST) read(tps=14009 timeouts=0 errors=0) write(tps=14119 timeouts=0 errors=0)
### Summary Reports
info: Fri Oct 02 2015 00:03:57 GMT+0530 (IST) read(tps=14691 timeouts=0 errors=0) write(tps=14581 timeouts=0 errors=0)
The program will generate a report of the test after it has completed. The report will contain several kinds of data, including transactions per second, memory use, and status codes.
info: Fri Oct 02 2015 00:03:58 GMT+0530 (IST) read(tps=14200 timeouts=0 errors=0) write(tps=14200 timeouts=0 errors=0)
This will requires the main program to store the information for the summary report in memory.
In the end it prints the summary of benchmark run in the following format.
If you do not want a summary report, then use the `--no-summary` option.
SUMMARY
- Configuration
- operations : 100
- iterations : undefined
- processes : 4
- time : 30 seconds
- Durations : latency histogram of read/write operations.
| <=1 | >1 | >2 | >4 | >8 | >16 | >32 |
|---|---|---|---|---|---|---|
| 8.4% |11.9% | 21.7% |27.0% |18.4% |10.6% |1.9% |
- Status Codes : histogram for return values of read/write operations.
| 0 |
|---|
|100.0% |

@@ -32,2 +32,3 @@ # Client Class

- [info()](#info)
- [indexCreateWait()](#indexCreateWait)
- [indexRemove()](#indexRemove)

@@ -42,2 +43,3 @@ - [LargeList()](#largeList)

- [udfRegister()](#udfRegister)
- [udfRegisterWait()](#udfRegisterWait)
- [udfRemove()](#udfRemove)

@@ -343,3 +345,5 @@ - [updateLogging()](#updateLogging)

Creates an integer index.
Creates an integer index. It's an asynchronous API that issues the index create command
to aerospike cluster. To verify that index has been created and populated with all the
data use [indexCreateWait()](#indexCreateWait) API.

@@ -380,3 +384,5 @@ Parameters:

Creates a string index.
Creates a string index. It's an asynchronous API that issues the index create command
to aerospike cluster. To verify that index has been created and populated with all the
data use [indexCreateWait()](#indexCreateWait) API.

@@ -595,4 +601,49 @@ Parameters:

```
<!--
################################################################################
indexCreateWait()
################################################################################
-->
<a name="indexCreateWait"></a>
### indexCreateWait(namespace, index, pollInterval, callback)
Wait until an index create command succeeds in aerospike cluster. This function returns
only when index is ready to be queried.
Parameters:
- `namespace` – The namespace on which the index is created.
- `index` – The name of the index created.
- `pollInterval`- The poll interval in milliseconds to check the index creation status.
- `callback` – The function to call when the operation completes with the results of the operation.
The parameters for the `callback` argument:
- `error` – The [Error object](datamodel.md#error) representing the status of
the operation.
Example:
```js
var args = { ns: "test", set: "demo", bin: "bin1", index:"index_name"}
client.createIntegerIndex(args, function (error) {
if ( error.status == aerospike.Status.AEROSPIKE_OK ) {
client.indexCreateWait('test', 'index', 1000, function(error) {
if(error.code !== aerospike.status.AEROSPIKE_OK) {
// index creation failed.
}
});
}
else {
// Index create request failed.
}
})
```
<!--
################################################################################
LargeList()

@@ -844,3 +895,4 @@ ################################################################################

Registers an UDF to the database cluster.
Registers an UDF to the database cluster. To verify that UDF is present in all the nodes
refer [udfRegisterWait()](#udfREgisterWait)

@@ -865,4 +917,43 @@ Parameters:

```
<!--
################################################################################
udfRegisterWait()
################################################################################
-->
<a name="udfRegisterWait"></a>
### udfRegisterWait(udfFilename, pollInterval, policy=null, callback)
Wait until the UDF registration succeeds in aerospike cluster. This function returns only when the
UDF registered is available with all the nodes in aerospike cluster.
Parameters:
- `udfFilename` – UDF filename for which the status has to be checked.
- `pollInterval`- The status of UDF registration checked regularly with this Interval. Specified in milliseconds.
- `policy` – (optional) The [Info Policy object](policies.md#InfoPolicy) to use for this operation.
- `callback` – The function to call when the operation completes with the results of the operation.
The parameters for the `callback` argument:
- `error` – The [Error object](datamodel.md#error) representing the status of
the operation.
Example:
```js
client.udfRegister("path/to/file/filename", function(error) {
if(error.code === aerospike.status.AEROSPIKE_OK) {
client.udfRegisterWait( filename, 1000, function(err) {
if(err.code !== aerospike.status.AEROSPIKE_OK) {
// error in registration.
}
});
}
});
```
<!--
################################################################################
udfRemove()

@@ -869,0 +960,0 @@ ################################################################################

@@ -9,3 +9,3 @@ # Filters

```js
var filter = aerospike.filters
var filter = aerospike.filter

@@ -61,6 +61,6 @@ var queryArgs = {

- `bin` – The name of the bin to apply the filter to.
- `min` – The minimum value of the bin, the records with bin value greater than
min will be returned as part of query result.
- `max` - The maximum value of the bin, the records with bin value less than max
will be returned as part of query result.
- `min` – The minimum value of the bin, the records with bin value equal to or greater than
min will be returned as part of query result (min value is inclusive).
- `max` - The maximum value of the bin, the records with bin value equal to or less than max
will be returned as part of query result ( max value is inclusive).
```js

@@ -67,0 +67,0 @@ filter.range('b', 1, 1000)

@@ -173,3 +173,3 @@ /*******************************************************************************

set: argv.set,
key: keyv
key: keyv + iteration.current
};

@@ -223,2 +223,2 @@

}
})
})

@@ -199,3 +199,3 @@ /*******************************************************************************

} else {
!argv.quiet && console.log("OK.");
isIndexCreated(client, argv.namespace, index, 1000);
}

@@ -208,4 +208,5 @@ });

process.exit(1);
} else {
!argv.quiet && console.log("OK.");
}
else {
isIndexCreated(client, argv.namespace, index, 1000);
}

@@ -227,2 +228,3 @@ });

default:
console.log(err);
console.error("Error: " + err.message);

@@ -236,2 +238,13 @@ return true;

function isIndexCreated(client, namespace, index, pollInterval) {
client.indexCreateWait(namespace, index, pollInterval, function(err) {
if (isError(err)) {
process.exit(1);
}
else {
!argv.quiet && console.log("Index Created - %s", index);
}
});
}
aerospike.client(config).connect(function(err, client) {

@@ -243,2 +256,2 @@ if (err && err.code != Status.AEROSPIKE_OK) {

}
});
});

@@ -61,3 +61,3 @@ /*******************************************************************************

alias: "t",
default: 10,
default: 1000,
describe: "Timeout in milliseconds."

@@ -164,3 +164,3 @@ },

function isError(err) {
if (err && err.code != Status.AEROSPIKE_OK) {
if (err && err.code !== Status.AEROSPIKE_OK) {
console.error("Error: " + err.message);

@@ -179,2 +179,2 @@ return true;

}
});
});

@@ -29,2 +29,3 @@ var count = 0;

next: next,
};
current: current
};

@@ -32,3 +32,2 @@ /*******************************************************************************

console.log(Double);
/*******************************************************************************

@@ -159,3 +158,3 @@ *

set: argv.set,
key: keyv + iteration
key: keyv + iteration.current
};

@@ -178,3 +177,2 @@

console.log(bins.x);
var metadata = {

@@ -181,0 +179,0 @@ ttl: 10000,

@@ -163,4 +163,9 @@ /*******************************************************************************

} else {
!argv.quiet && console.log("OK.");
iteration.next(run, client);
client.udfRegisterWait(file, 1000, function(err) {
if(isError(err)) {
process.exit(1);
} else {
!argv.quiet && console.log("UDF Registration Successful - %s", file);
}
});
}

@@ -185,2 +190,2 @@ });

}
});
});

@@ -154,2 +154,22 @@ var as = require('../build/Release/aerospike.node');

createGeo2DSphereIndex = function(options, callback) {
var policy;
var set;
if (options && options.policy) {
policy = options.policy;
}
if (options && options.set) {
set = options.set;
}
this.indexCreate(
options.ns,
set,
options.bin,
options.index,
as.indexType.GEO2DSPHERE,
policy,
callback
);
};
parseOperateArgs = function(args) {

@@ -252,2 +272,6 @@ var arglength = args.length;

if (!proto.createGeo2DSphereIndex) {
proto.createGeo2DSphereIndex = createGeo2DSphereIndex;
}
if (!proto.LargeList) {

@@ -339,7 +363,36 @@ proto.LargeList = LargeList;

var geo_within_filter = function(args) {
var obj = {};
obj.predicate = as.predicates.RANGE;
obj.type = as.indexType.GEO2DSPHERE;
obj.bin = arguments[0];
obj.val = arguments[1];
return obj;
};
var geo_contains_filter = function(args) {
var obj = {};
obj.predicate = as.predicates.RANGE;
obj.type = as.indexType.GEO2DSPHERE;
obj.bin = arguments[0];
obj.val = arguments[1];
return obj;
};
aerospike.filter = {
equal: equal_filter,
range: range_filter
range: range_filter,
geoWithin: geo_within_filter,
geoContains: geo_contains_filter
};
function GeoJSON(strval) {
if (this instanceof GeoJSON) {
this.str = strval
} else {
return new GeoJSON(strval);
}
};
aerospike.GeoJSON = GeoJSON;
module.exports = aerospike;
{
"name": "aerospike",
"version": "1.0.51",
"version": "1.0.52",
"description": "Aerospike Client Library",

@@ -5,0 +5,0 @@ "tags": [

@@ -84,4 +84,33 @@ /*******************************************************************************

});
it('should create an integer index and wait until index creation is done', function(done) {
var args = { ns: options.namespace,
set: options.set,
bin : "integer_done",
index: "integer_index_done" }
client.createIntegerIndex(args, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
client.indexCreateWait(options.namespace, "integer_index_done", 1000, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
done();
});
});
});
it('should create a string index and wait until index creation is done', function(done) {
var args = { ns: options.namespace,
set: options.set,
bin : "string_done",
index: "string_index_done" }
client.createStringIndex(args, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
client.indexCreateWait(options.namespace, "string_index_done", 1000, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
done();
});
});
});
});

@@ -103,2 +103,16 @@ /*******************************************************************************

});
it('should register an UDF file to aerospike cluster and wait until all registration is done across all nodes in Aerospike cluster', function(done) {
var dir = __dirname;
var filename = dir + "/udf_test.lua"
client.udfRegister(filename, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
client.udfRegisterWait("udf_test.lua", 1000, function(err) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
done();
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc