1
0
Fork 0
This commit is contained in:
jsteemann 2018-08-16 09:26:44 +02:00
parent d6a3b66e2a
commit c6de98882c
4 changed files with 14 additions and 14 deletions

View File

@ -493,16 +493,12 @@ jsunity.run(function IResearchAqlTestSuite_s4_r1() {
return IResearchAqlTestSuite({ numberOfShards: 4, replicationFactor: 1 });
});
jsunity.run(function IResearchAqlTestSuite_s1_r2() {
return IResearchAqlTestSuite({ numberOfShards: 1, replicationFactor: 2 })
return IResearchAqlTestSuite({ numberOfShards: 1, replicationFactor: 2 });
});
jsunity.run(function IResearchAqlTestSuite_s4_r3() {
return IResearchAqlTestSuite({ numberOfShards: 4, replicationFactor: 3 })
return IResearchAqlTestSuite({ numberOfShards: 4, replicationFactor: 3 });
});
return jsunity.done();

View File

@ -597,7 +597,7 @@ function CollectionCacheSuite () {
let p = c.properties();
assertTrue(p.cacheEnabled, p);
for(let i=0;i<10000;i++) {
for(let i = 0; i < 10000; i++) {
c.insert({_key:String(i), value : i});
}
@ -617,7 +617,7 @@ function CollectionCacheSuite () {
});
// hit 25%
for(let i=0;i<2500;i++) {
for(let i = 0; i < 2500; i++) {
let doc = c.document(String(i));
assertTrue(doc !== undefined);
}
@ -638,7 +638,7 @@ function CollectionCacheSuite () {
});
// hit same 25%
for(let i=0;i<2500;i++) {
for(let i = 0; i < 2500; i++) {
let doc = c.document(String(i));
assertTrue(doc !== undefined);
}
@ -646,24 +646,27 @@ function CollectionCacheSuite () {
// no new documents were hit
let f2 = c.figures();
assertTrue(f2.cacheInUse);
// anyway, the cache usage may be different, because there is
// no guarantee any document makes it into the cache
assertEqual(f.cacheSize, f2.cacheSize);
/*
assertTrue(Math.abs(f.cacheUsage - f2.cacheUsage) < 2048,
Math.abs(f.cacheUsage - f2.cacheUsage));
// first no hits, second time all hits ~= 50% hit-rate
assertTrue(Math.abs(f2.cacheLifeTimeHitRate - 50) < 5, f2.cacheLifeTimeHitRate);
assertTrue(Math.abs(f2.cacheLifeTimeHitRate - 50) < 11, f2.cacheLifeTimeHitRate);
*/
let idxs2 = c.getIndexes(true);
idxs2.forEach(function(idx, i) {
if (idx.figures.cacheInUse) {
assertEqual(idx.figures.cacheSize, idxs[i].figures.cacheSize);
assertTrue(Math.abs(idx.figures.cacheUsage - idxs[i].figures.cacheUsage) < 2048,
Math.abs(idx.figures.cacheUsage - idxs[i].figures.cacheUsage));
assertTrue(Math.abs(idx.figures.cacheLifeTimeHitRate - 50) < 5);
assertTrue(Math.abs(idx.figures.cacheLifeTimeHitRate - 50) < 11);
}
});
// hit different 25%
for(let i=5000;i<7500;i++) {
for(let i = 5000; i < 7500; i++) {
let doc = c.document(String(i));
assertTrue(doc !== undefined);
}

View File

@ -1,4 +1,4 @@
/* global describe, it, beforeEach, afterEach, it */
/* global describe, it, beforeEach, afterEach */
'use strict';
// //////////////////////////////////////////////////////////////////////////////

View File

@ -1,3 +1,4 @@
/* global describe, it */
"use strict";
const util = require("@arangodb/util");
const { expect } = require("chai");