Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libV2/warp10.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class Warp10Client {
this._readToken = (config && config.readToken) || 'readTokenStatic';
this.nodeId = (config && config.nodeId) || _config.nodeId;
const proto = (config && config.tls) ? 'https' : 'http';
this._requestTimeout = (config && config.requestTimeout) || 30000;
this._connectTimeout = (config && config.connectTimeout) || 30000;
const host = (config && config.host) || '127.0.0.1';
const port = (config && config.port) || 4802;
this._client = new Warp10().endpoint(`${proto}://${host}:${port}`, this._requestTimeout, this._connectTimeout);
this._requestTimeout = (config && config.requestTimeout) || 60000;
this._connectTimeout = (config && config.connectTimeout) || 60000;
this._client = new Warp10(`${proto}://${host}:${port}`, this._requestTimeout, this._connectTimeout);
Comment on lines +20 to +22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add some comments for the reasoning of choosing this value please for the future us.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just to match the default value that actually gets used from the config

"requestTimeout": 60000,

}

async update(payload) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"engines": {
"node": ">=22"
},
"version": "8.2.5",
"version": "8.2.6",
"description": "API for tracking resource utilization and reporting metrics",
"main": "index.js",
"repository": {
Expand All @@ -18,7 +18,7 @@
"homepage": "https://github.com/scality/utapi#readme",
"dependencies": {
"@hapi/joi": "^17.1.1",
"@senx/warp10": "^2.0.3",
"@senx/warp10": "1.0.14",
"arsenal": "git+https://github.com/scality/Arsenal#8.2.28",
"async": "^3.2.6",
"aws-sdk": "^2.1005.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/v2/task/testCreateCheckpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ describe('Test CreateCheckpoint', function () {
className: 'utapi.checkpoint', labels: { node: prefix }, start: getTs(1), stop: 10 * 1000 * 1000,
});

assert.strictEqual(results.result.length, 0);
assert.strictEqual(JSON.parse(results.result[0]).length, 0);
});
});
4 changes: 2 additions & 2 deletions tests/functional/v2/task/testIngestShards.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('Test IngestShards', function () {
const results = await warp10.fetch({
className: 'utapi.event', labels: { node: prefix }, start: start + 1, stop: -2,
});
const series = results.result[0];
const series = JSON.parse(results.result[0])[0];
const timestamps = series.v.map(ev => ev[0]);
assert.deepStrictEqual([
start + 1,
Expand Down Expand Up @@ -213,7 +213,7 @@ describe('Test IngestShards', function () {
className: 'utapi.event', labels: { node: prefix }, start: start + 10, stop: -2,
});

const series = results.result[0];
const series = JSON.parse(results.result[0])[0];
const timestamps = series.v.map(ev => ev[0]);
assert.deepStrictEqual([
start + 5,
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/v2/warp10/testClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Test Warp Client', () => {
it('should fetch records', async () => {
await warp10.ingest({ className }, testValues);
const res = await warp10.fetch({ className, start: `${new Date().getTime()}000`, stop: -100 });
const parsed = res.result[0];
const parsed = JSON.parse(res.result[0])[0];
assert.strictEqual(parsed.c, className);
assert.deepStrictEqual(
parsed.v.map(v => v[0]),
Expand All @@ -44,10 +44,10 @@ describe('Test Warp Client', () => {
const ev = generateFakeEvents(startTime, endTime, 100);
const count = await warp10.ingest({ className }, ev);
let fetchResp = await warp10.fetch({ className, start: endTime, stop: startTime });
assert.strictEqual(fetchResp.result.length, 1);
assert.strictEqual(fetchResp.result[0].v.length, count);
assert.strictEqual(JSON.parse(fetchResp.result[0]).length, 1);
assert.strictEqual(JSON.parse(fetchResp.result[0])[0].v.length, count);
await warp10.delete({ className, start: startTime, end: endTime });
fetchResp = await warp10.fetch({ className, start: endTime, stop: startTime });
assert.strictEqual(fetchResp.result.length, 0);
assert.strictEqual(JSON.parse(fetchResp.result[0]).length, 0);
});
});
Loading
Loading