cds-caching 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/app/dashboard/resources/Eventing-preload-0.js +1 -1
- package/app/dashboard/resources/Library-preload.js +1 -1
- package/app/dashboard/resources/sap/ui/Global-dbg.js +1 -1
- package/app/dashboard/resources/sap/ui/Global.js +1 -1
- package/app/dashboard/resources/sap/ui/test/starter/runTest.js +1 -1
- package/app/dashboard/resources/sap-ui-core-nojQuery.js +1 -1
- package/app/dashboard/resources/sap-ui-core.js +1 -1
- package/app/dashboard/resources/sap-ui-custom.js +1 -1
- package/lib/operations/CapOperations.js +1 -3
- package/lib/support/StatisticsPersistenceManager.js +54 -52
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Please also read the introduction blog post: [Boosting performance in SAP Cloud
|
|
|
33
33
|
| [Deployment Guide](docs/deployment-guide.md) | SAP BTP deployment for Redis, PostgreSQL, HANA, CDS |
|
|
34
34
|
| [Migration Guide](docs/migration-guide.md) | **Upgrading to 2.0** and earlier releases |
|
|
35
35
|
| [Example Application](docs/example-app.md) | Sample app with caching patterns |
|
|
36
|
+
| [Federation Integration](docs/federation.md) | Using cds-caching with [cds-data](https://github.com/mikezaschka/cds-data) |
|
|
36
37
|
|
|
37
38
|
## Getting Started
|
|
38
39
|
|
|
@@ -436,6 +437,10 @@ To add the monitoring dashboard, use `metrics.reuse.dashboard` for local reuse,
|
|
|
436
437
|
| [Programmatic API](docs/programmatic-api.md) | JavaScript methods for cache operations |
|
|
437
438
|
| [OData API](docs/odata-api.md) | REST endpoints for monitoring and management |
|
|
438
439
|
|
|
440
|
+
## Related Projects
|
|
441
|
+
|
|
442
|
+
[cds-data](https://github.com/mikezaschka/cds-data) provides composable CAP plugins for federation, replication, and materialization. Use `cds-caching` as the optional peer for `cache.strategy: 'response'` on `@federation.delegate` / `@federation.replicate` views — see [Federation Integration](docs/federation.md).
|
|
443
|
+
|
|
439
444
|
## Contributing
|
|
440
445
|
|
|
441
446
|
Contributions are welcome! Please submit pull requests to the [repository](https://github.com/mikezaschka/cds-caching).
|
|
@@ -102,7 +102,7 @@ sap.ui.predefine("sap/base/util/merge", ["./_merge"],function(e){"use strict";va
|
|
|
102
102
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
103
103
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
104
104
|
*/
|
|
105
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
105
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
106
106
|
/*!
|
|
107
107
|
* OpenUI5
|
|
108
108
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -76,7 +76,7 @@ sap.ui.predefine("sap/base/util/resolveReference", ["sap/base/util/ObjectPath"],
|
|
|
76
76
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
77
77
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
78
78
|
*/
|
|
79
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
79
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
80
80
|
/*!
|
|
81
81
|
* OpenUI5
|
|
82
82
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -61,7 +61,7 @@ sap.ui.define([
|
|
|
61
61
|
*/
|
|
62
62
|
version: "1.136.0",
|
|
63
63
|
// buildinfo.lastchange is deprecated and is therefore defaulted to empty string
|
|
64
|
-
buildinfo : { lastchange : "", buildtime : "
|
|
64
|
+
buildinfo : { lastchange : "", buildtime : "20260716-2315" }
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
|
-
sap.ui.define(["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
6
|
+
sap.ui.define(["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
7
7
|
//# sourceMappingURL=Global.js.map
|
|
@@ -351,7 +351,7 @@ sap.ui.predefine("sap/base/util/uid", [],function(){"use strict";var e=0;var n=f
|
|
|
351
351
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
352
352
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
353
353
|
*/
|
|
354
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
354
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
355
355
|
/*!
|
|
356
356
|
* OpenUI5
|
|
357
357
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -344,7 +344,7 @@ sap.ui.predefine("sap/base/util/uid", [],function(){"use strict";var e=0;var n=f
|
|
|
344
344
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
345
345
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
346
346
|
*/
|
|
347
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
347
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
348
348
|
/*!
|
|
349
349
|
* OpenUI5
|
|
350
350
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -344,7 +344,7 @@ sap.ui.predefine("sap/base/util/uid", [],function(){"use strict";var e=0;var n=f
|
|
|
344
344
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
345
345
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
346
346
|
*/
|
|
347
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
347
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
348
348
|
/*!
|
|
349
349
|
* OpenUI5
|
|
350
350
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -1657,7 +1657,7 @@ sap.ui.predefine("sap/tnt/library", ["./IllustratedMessageType","sap/ui/base/Dat
|
|
|
1657
1657
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
1658
1658
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
1659
1659
|
*/
|
|
1660
|
-
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"
|
|
1660
|
+
sap.ui.predefine("sap/ui/Global", ["sap/ui/VersionInfo","sap/base/Log","sap/base/assert","sap/base/util/ObjectPath"],function(e,a,r,t){"use strict";if(globalThis.OpenAjax&&globalThis.OpenAjax.hub){OpenAjax.hub.registerLibrary("sap","http://www.sap.com/","0.1",{})}var n;let s={version:"1.136.0",buildinfo:{lastchange:"",buildtime:"20260716-2315"}};s=Object.assign(sap.ui,s);var o=sap.ui.loader._.getSyncCallBehavior();sap.ui.getVersionInfo=function(r){if(r&&r.async){a.info("Do not use deprecated function 'sap.ui.getVersionInfo'. Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead")}else{a.warning("Do not use deprecated function 'sap.ui.getVersionInfo' synchronously! Use"+" 'sap/ui/VersionInfo' module's asynchronous .load function instead","Deprecation",null,function(){return{type:"sap.ui.getVersionInfo",name:"Global"}})}return e._load(r)};sap.ui.namespace=function(e){r(false,"sap.ui.namespace is long time deprecated and shouldn't be used");return t.create(e)};sap.ui.lazyRequire=function(e,s,i){r(typeof e==="string"&&e,"lazyRequire: sClassName must be a non-empty string");r(!s||typeof s==="string","lazyRequire: sMethods must be empty or a string");if(o===2){a.error("[nosync] lazy stub creation ignored for '"+e+"'");return}var u=e.replace(/\//gi,"."),l=u.lastIndexOf("."),c=u.substr(0,l),p=u.substr(l+1),f=t.create(c),y=f[p],d=(s||"new").split(" "),b=d.indexOf("new");i=i||u;if(!y){if(b>=0){y=function(){if(o){if(o===1){a.error("[nosync] lazy stub for constructor '"+u+"' called")}}else{a.debug("lazy stub for constructor '"+u+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function","lazyRequire: oRealClass must be a function after loading");if(t._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"'has not been replaced by module '"+i+"'")}var s=Object.create(t.prototype);if(!(this instanceof y)){n=n||sap.ui.require("sap/ui/base/Object");if(n&&s instanceof n){a.error("Constructor "+e+' has been called without "new" operator!',null,null,function(){try{throw new Error}catch(e){return e}})}}var l=t.apply(s,arguments);if(l&&(typeof l==="function"||typeof l==="object")){s=l}return s};y._sapUiLazyLoader=true;d.splice(b,1)}else{y={}}f[p]=y}d.forEach(function(e){if(!y[e]){y[e]=function(){if(o){if(o===1){a.error("[no-sync] lazy stub for method '"+u+"."+e+"' called")}}else{a.debug("lazy stub for method '"+u+"."+e+"' called.")}sap.ui.requireSync(i.replace(/\./g,"/"));var t=f[p];r(typeof t==="function"||typeof t==="object","lazyRequire: oRealClass must be a function or object after loading");r(typeof t[e]==="function","lazyRequire: method must be a function");if(t[e]._sapUiLazyLoader){throw new Error("lazyRequire: stub '"+u+"."+e+"' has not been replaced by loaded module '"+i+"'")}return t[e].apply(t,arguments)};y[e]._sapUiLazyLoader=true}})};sap.ui.lazyRequire._isStub=function(e){r(typeof e==="string"&&e,"lazyRequire._isStub: sClassName must be a non-empty string");var a=e.lastIndexOf("."),n=e.slice(0,a),s=e.slice(a+1),o=t.get(n||"");return!!(o&&typeof o[s]==="function"&&o[s]._sapUiLazyLoader)};sap.ui.resource=function(e,a){r(typeof e==="string","sLibraryName must be a string");r(typeof a==="string","sResourcePath must be a string");return sap.ui.require.toUrl((String(e).replace(/\./g,"/")+"/"+a).replace(/^\/*/,""))};sap.ui.localResources=function(e){r(e,"sNamespace must not be empty");var a={};a[e.replace(/\./g,"/")]="./"+e.replace(/\./g,"/");sap.ui.loader.config({paths:a})};return s});
|
|
1661
1661
|
/*!
|
|
1662
1662
|
* OpenUI5
|
|
1663
1663
|
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
@@ -29,7 +29,7 @@ class CapOperations {
|
|
|
29
29
|
async safeCacheOperation(operation, operationName, context = {}) {
|
|
30
30
|
try {
|
|
31
31
|
const result = await operation();
|
|
32
|
-
this.log.
|
|
32
|
+
this.log._debug && this.log.debug('RESULT', { result, operationName, context });
|
|
33
33
|
return { success: true, result, error: null };
|
|
34
34
|
} catch (error) {
|
|
35
35
|
this.log.warn(`Cache ${operationName} failed:`, {
|
|
@@ -472,8 +472,6 @@ class CapOperations {
|
|
|
472
472
|
cacheErrors.push(setResult.error);
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
-
this.log.info('REEEESULT', { setResult, cacheErrors, wrappedValue });
|
|
476
|
-
|
|
477
475
|
return {
|
|
478
476
|
result: data,
|
|
479
477
|
cacheKey: query.cacheKey,
|
|
@@ -37,13 +37,14 @@ class StatisticsPersistenceManager {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
40
|
+
const { Metrics } = cds.entities('plugin.cds_caching');
|
|
41
|
+
const existingHourly = await SELECT.one.from(Metrics)
|
|
41
42
|
.where({ ID: hourlyId, cache: this.cacheName });
|
|
42
43
|
|
|
43
44
|
if (!existingHourly) {
|
|
44
|
-
await this._createHourlyStats(stats, hourlyId, hourlyTimestamp);
|
|
45
|
+
await this._createHourlyStats(Metrics, stats, hourlyId, hourlyTimestamp);
|
|
45
46
|
} else {
|
|
46
|
-
await this._updateHourlyStats(stats, hourlyId, existingHourly);
|
|
47
|
+
await this._updateHourlyStats(Metrics, stats, hourlyId, existingHourly);
|
|
47
48
|
}
|
|
48
49
|
} catch (error) {
|
|
49
50
|
this.log.error(`Failed to persist hourly stats for cache ${this.cacheName}:`, error);
|
|
@@ -66,9 +67,10 @@ class StatisticsPersistenceManager {
|
|
|
66
67
|
|
|
67
68
|
this.log.debug(`Persisting ${keyAccess.size} key access records for cache ${this.cacheName}`);
|
|
68
69
|
|
|
70
|
+
const { KeyMetrics } = cds.entities('plugin.cds_caching');
|
|
69
71
|
for (const [key, keyStats] of keyAccess) {
|
|
70
72
|
try {
|
|
71
|
-
await this._persistKeyMetric(key, keyStats);
|
|
73
|
+
await this._persistKeyMetric(KeyMetrics, key, keyStats);
|
|
72
74
|
} catch (error) {
|
|
73
75
|
this.log.error(`Failed to persist key metric for key ${key}:`, error);
|
|
74
76
|
}
|
|
@@ -101,8 +103,8 @@ class StatisticsPersistenceManager {
|
|
|
101
103
|
* Create new hourly stats record
|
|
102
104
|
* @private
|
|
103
105
|
*/
|
|
104
|
-
async _createHourlyStats(stats, hourlyId, hourlyTimestamp) {
|
|
105
|
-
await INSERT.into(
|
|
106
|
+
async _createHourlyStats(Metrics, stats, hourlyId, hourlyTimestamp) {
|
|
107
|
+
await INSERT.into(Metrics).entries([{
|
|
106
108
|
ID: hourlyId,
|
|
107
109
|
cache: this.cacheName,
|
|
108
110
|
timestamp: hourlyTimestamp,
|
|
@@ -153,10 +155,10 @@ class StatisticsPersistenceManager {
|
|
|
153
155
|
* Update existing hourly stats record
|
|
154
156
|
* @private
|
|
155
157
|
*/
|
|
156
|
-
async _updateHourlyStats(stats, hourlyId, existingHourly) {
|
|
158
|
+
async _updateHourlyStats(Metrics, stats, hourlyId, existingHourly) {
|
|
157
159
|
const updatedStats = this._calculateUpdatedStats(stats, existingHourly);
|
|
158
160
|
|
|
159
|
-
await UPDATE(
|
|
161
|
+
await UPDATE(Metrics)
|
|
160
162
|
.set(updatedStats)
|
|
161
163
|
.where({ ID: hourlyId, cache: this.cacheName });
|
|
162
164
|
this.log.debug(`Updated existing hourly stats for cache ${this.cacheName}`);
|
|
@@ -169,19 +171,19 @@ class StatisticsPersistenceManager {
|
|
|
169
171
|
_calculateUpdatedStats(stats, existingHourly) {
|
|
170
172
|
const updatedStats = {
|
|
171
173
|
// Read-through metrics
|
|
172
|
-
hits: existingHourly.hits + stats.hits,
|
|
173
|
-
misses: existingHourly.misses + stats.misses,
|
|
174
|
-
errors: existingHourly.errors + stats.errors,
|
|
175
|
-
totalRequests: existingHourly.totalRequests + stats.totalRequests,
|
|
174
|
+
hits: (Number(existingHourly.hits) || 0) + stats.hits,
|
|
175
|
+
misses: (Number(existingHourly.misses) || 0) + stats.misses,
|
|
176
|
+
errors: (Number(existingHourly.errors) || 0) + stats.errors,
|
|
177
|
+
totalRequests: (Number(existingHourly.totalRequests) || 0) + stats.totalRequests,
|
|
176
178
|
|
|
177
179
|
// Native function metrics
|
|
178
|
-
nativeSets: existingHourly.nativeSets + stats.nativeSets,
|
|
179
|
-
nativeGets: existingHourly.nativeGets + stats.nativeGets,
|
|
180
|
-
nativeDeletes: existingHourly.nativeDeletes + stats.nativeDeletes,
|
|
181
|
-
nativeClears: existingHourly.nativeClears + stats.nativeClears,
|
|
182
|
-
nativeDeleteByTags: existingHourly.nativeDeleteByTags + stats.nativeDeleteByTags,
|
|
183
|
-
nativeErrors: existingHourly.nativeErrors + stats.nativeErrors,
|
|
184
|
-
totalNativeOperations: existingHourly.totalNativeOperations + stats.totalNativeOperations,
|
|
180
|
+
nativeSets: (Number(existingHourly.nativeSets) || 0) + stats.nativeSets,
|
|
181
|
+
nativeGets: (Number(existingHourly.nativeGets) || 0) + stats.nativeGets,
|
|
182
|
+
nativeDeletes: (Number(existingHourly.nativeDeletes) || 0) + stats.nativeDeletes,
|
|
183
|
+
nativeClears: (Number(existingHourly.nativeClears) || 0) + stats.nativeClears,
|
|
184
|
+
nativeDeleteByTags: (Number(existingHourly.nativeDeleteByTags) || 0) + stats.nativeDeleteByTags,
|
|
185
|
+
nativeErrors: (Number(existingHourly.nativeErrors) || 0) + stats.nativeErrors,
|
|
186
|
+
totalNativeOperations: (Number(existingHourly.totalNativeOperations) || 0) + stats.totalNativeOperations,
|
|
185
187
|
|
|
186
188
|
// Common metrics
|
|
187
189
|
memoryUsage: stats.memoryUsage,
|
|
@@ -194,7 +196,7 @@ class StatisticsPersistenceManager {
|
|
|
194
196
|
|
|
195
197
|
// Weighted average for hit latency
|
|
196
198
|
if (updatedStats.hits > 0) {
|
|
197
|
-
const existingHitLatencySum = existingHourly.avgHitLatency * existingHourly.hits;
|
|
199
|
+
const existingHitLatencySum = (Number(existingHourly.avgHitLatency) || 0) * (Number(existingHourly.hits) || 0);
|
|
198
200
|
const newHitLatencySum = stats.avgHitLatency * stats.hits;
|
|
199
201
|
updatedStats.avgHitLatency = (existingHitLatencySum + newHitLatencySum) / updatedStats.hits;
|
|
200
202
|
} else {
|
|
@@ -203,7 +205,7 @@ class StatisticsPersistenceManager {
|
|
|
203
205
|
|
|
204
206
|
// Weighted average for miss latency
|
|
205
207
|
if (updatedStats.misses > 0) {
|
|
206
|
-
const existingMissLatencySum = existingHourly.avgMissLatency * existingHourly.misses;
|
|
208
|
+
const existingMissLatencySum = (Number(existingHourly.avgMissLatency) || 0) * (Number(existingHourly.misses) || 0);
|
|
207
209
|
const newMissLatencySum = stats.avgMissLatency * stats.misses;
|
|
208
210
|
updatedStats.avgMissLatency = (existingMissLatencySum + newMissLatencySum) / updatedStats.misses;
|
|
209
211
|
} else {
|
|
@@ -211,12 +213,12 @@ class StatisticsPersistenceManager {
|
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
// Weighted average for read-through latency (combined hits and misses)
|
|
214
|
-
const existingCount = (existingHourly.hits || 0) + (existingHourly.misses || 0);
|
|
216
|
+
const existingCount = (Number(existingHourly.hits) || 0) + (Number(existingHourly.misses) || 0);
|
|
215
217
|
const newCount = (stats.hits || 0) + (stats.misses || 0);
|
|
216
218
|
const totalCount = existingCount + newCount;
|
|
217
219
|
if (totalCount > 0) {
|
|
218
220
|
updatedStats.avgReadThroughLatency =
|
|
219
|
-
((existingHourly.avgReadThroughLatency || 0) * existingCount +
|
|
221
|
+
((Number(existingHourly.avgReadThroughLatency) || 0) * existingCount +
|
|
220
222
|
(stats.avgReadThroughLatency || 0) * newCount) / totalCount;
|
|
221
223
|
} else {
|
|
222
224
|
updatedStats.avgReadThroughLatency = 0;
|
|
@@ -242,10 +244,10 @@ class StatisticsPersistenceManager {
|
|
|
242
244
|
}
|
|
243
245
|
|
|
244
246
|
// Update percentiles (use max/min of existing and current, with min using mergeMin)
|
|
245
|
-
updatedStats.maxHitLatency = Math.max(existingHourly.maxHitLatency || 0, stats.maxHitLatency || 0);
|
|
246
|
-
updatedStats.maxMissLatency = Math.max(existingHourly.maxMissLatency || 0, stats.maxMissLatency || 0);
|
|
247
|
-
updatedStats.minHitLatency = mergeMin(existingHourly.minHitLatency, stats.minHitLatency);
|
|
248
|
-
updatedStats.minMissLatency = mergeMin(existingHourly.minMissLatency, stats.minMissLatency);
|
|
247
|
+
updatedStats.maxHitLatency = Math.max(Number(existingHourly.maxHitLatency) || 0, stats.maxHitLatency || 0);
|
|
248
|
+
updatedStats.maxMissLatency = Math.max(Number(existingHourly.maxMissLatency) || 0, stats.maxMissLatency || 0);
|
|
249
|
+
updatedStats.minHitLatency = mergeMin(Number(existingHourly.minHitLatency) || 0, stats.minHitLatency);
|
|
250
|
+
updatedStats.minMissLatency = mergeMin(Number(existingHourly.minMissLatency) || 0, stats.minMissLatency);
|
|
249
251
|
|
|
250
252
|
return updatedStats;
|
|
251
253
|
}
|
|
@@ -254,16 +256,16 @@ class StatisticsPersistenceManager {
|
|
|
254
256
|
* Persist a single key metric
|
|
255
257
|
* @private
|
|
256
258
|
*/
|
|
257
|
-
async _persistKeyMetric(key, keyStats) {
|
|
259
|
+
async _persistKeyMetric(KeyMetrics, key, keyStats) {
|
|
258
260
|
const keyId = `key:${this.cacheName}:${key}`;
|
|
259
261
|
|
|
260
|
-
const existingKey = await SELECT.one.from(
|
|
262
|
+
const existingKey = await SELECT.one.from(KeyMetrics)
|
|
261
263
|
.where({ ID: keyId, cache: this.cacheName, keyName: key });
|
|
262
264
|
|
|
263
265
|
if (!existingKey) {
|
|
264
|
-
await this._createKeyMetric(key, keyStats, keyId);
|
|
266
|
+
await this._createKeyMetric(KeyMetrics, key, keyStats, keyId);
|
|
265
267
|
} else {
|
|
266
|
-
await this._updateKeyMetric(key, keyStats, keyId, existingKey);
|
|
268
|
+
await this._updateKeyMetric(KeyMetrics, key, keyStats, keyId, existingKey);
|
|
267
269
|
}
|
|
268
270
|
}
|
|
269
271
|
|
|
@@ -271,9 +273,9 @@ class StatisticsPersistenceManager {
|
|
|
271
273
|
* Create new key metric record
|
|
272
274
|
* @private
|
|
273
275
|
*/
|
|
274
|
-
async _createKeyMetric(key, keyStats, keyId) {
|
|
276
|
+
async _createKeyMetric(KeyMetrics, key, keyStats, keyId) {
|
|
275
277
|
|
|
276
|
-
await INSERT.into(
|
|
278
|
+
await INSERT.into(KeyMetrics).entries([{
|
|
277
279
|
ID: keyId,
|
|
278
280
|
cache: this.cacheName,
|
|
279
281
|
keyName: key,
|
|
@@ -339,41 +341,41 @@ class StatisticsPersistenceManager {
|
|
|
339
341
|
* Update existing key metric record
|
|
340
342
|
* @private
|
|
341
343
|
*/
|
|
342
|
-
async _updateKeyMetric(key, keyStats, keyId, existingKey) {
|
|
343
|
-
const totalHits = existingKey.hits + keyStats.hits;
|
|
344
|
-
const totalMisses = existingKey.misses + keyStats.misses;
|
|
344
|
+
async _updateKeyMetric(KeyMetrics, key, keyStats, keyId, existingKey) {
|
|
345
|
+
const totalHits = (Number(existingKey.hits) || 0) + keyStats.hits;
|
|
346
|
+
const totalMisses = (Number(existingKey.misses) || 0) + keyStats.misses;
|
|
345
347
|
|
|
346
348
|
const updatedKeyStats = {
|
|
347
349
|
hits: totalHits,
|
|
348
350
|
misses: totalMisses,
|
|
349
|
-
errors: (existingKey.errors || 0) + (keyStats.errors || 0),
|
|
351
|
+
errors: (Number(existingKey.errors) || 0) + (keyStats.errors || 0),
|
|
350
352
|
totalRequests: totalHits + totalMisses,
|
|
351
353
|
lastAccess: new Date(keyStats.lastAccess).toISOString(),
|
|
352
354
|
|
|
353
355
|
// Native function metrics
|
|
354
|
-
nativeHits: (existingKey.nativeHits || 0) + (keyStats.nativeHits || 0),
|
|
355
|
-
nativeMisses: (existingKey.nativeMisses || 0) + (keyStats.nativeMisses || 0),
|
|
356
|
-
nativeSets: (existingKey.nativeSets || 0) + (keyStats.nativeSets || 0),
|
|
357
|
-
nativeDeletes: (existingKey.nativeDeletes || 0) + (keyStats.nativeDeletes || 0),
|
|
358
|
-
nativeClears: (existingKey.nativeClears || 0) + (keyStats.nativeClears || 0),
|
|
359
|
-
nativeDeleteByTags: (existingKey.nativeDeleteByTags || 0) + (keyStats.nativeDeleteByTags || 0),
|
|
360
|
-
nativeErrors: (existingKey.nativeErrors || 0) + (keyStats.nativeErrors || 0),
|
|
361
|
-
totalNativeOperations: (existingKey.totalNativeOperations || 0) + (keyStats.totalNativeOperations || 0),
|
|
356
|
+
nativeHits: (Number(existingKey.nativeHits) || 0) + (keyStats.nativeHits || 0),
|
|
357
|
+
nativeMisses: (Number(existingKey.nativeMisses) || 0) + (keyStats.nativeMisses || 0),
|
|
358
|
+
nativeSets: (Number(existingKey.nativeSets) || 0) + (keyStats.nativeSets || 0),
|
|
359
|
+
nativeDeletes: (Number(existingKey.nativeDeletes) || 0) + (keyStats.nativeDeletes || 0),
|
|
360
|
+
nativeClears: (Number(existingKey.nativeClears) || 0) + (keyStats.nativeClears || 0),
|
|
361
|
+
nativeDeleteByTags: (Number(existingKey.nativeDeleteByTags) || 0) + (keyStats.nativeDeleteByTags || 0),
|
|
362
|
+
nativeErrors: (Number(existingKey.nativeErrors) || 0) + (keyStats.nativeErrors || 0),
|
|
363
|
+
totalNativeOperations: (Number(existingKey.totalNativeOperations) || 0) + (keyStats.totalNativeOperations || 0),
|
|
362
364
|
|
|
363
365
|
// Weighted average for hit latency
|
|
364
366
|
avgHitLatency: totalHits > 0
|
|
365
|
-
? ((existingKey.avgHitLatency * existingKey.hits) + (keyStats.avgHitLatency * keyStats.hits)) / totalHits
|
|
367
|
+
? (((Number(existingKey.avgHitLatency) || 0) * (Number(existingKey.hits) || 0)) + (keyStats.avgHitLatency * keyStats.hits)) / totalHits
|
|
366
368
|
: 0,
|
|
367
369
|
// Weighted average for miss latency
|
|
368
370
|
avgMissLatency: totalMisses > 0
|
|
369
|
-
? ((existingKey.avgMissLatency * existingKey.misses) + (keyStats.avgMissLatency * keyStats.misses)) / totalMisses
|
|
371
|
+
? (((Number(existingKey.avgMissLatency) || 0) * (Number(existingKey.misses) || 0)) + (keyStats.avgMissLatency * keyStats.misses)) / totalMisses
|
|
370
372
|
: 0,
|
|
371
373
|
|
|
372
374
|
// Update percentiles (use max/min of existing and current, with min using mergeMin)
|
|
373
|
-
minHitLatency: mergeMin(existingKey.minHitLatency, keyStats.minHitLatency),
|
|
374
|
-
maxHitLatency: Math.max(existingKey.maxHitLatency || 0, keyStats.maxHitLatency || 0),
|
|
375
|
-
minMissLatency: mergeMin(existingKey.minMissLatency, keyStats.minMissLatency),
|
|
376
|
-
maxMissLatency: Math.max(existingKey.maxMissLatency || 0, keyStats.maxMissLatency || 0)
|
|
375
|
+
minHitLatency: mergeMin(Number(existingKey.minHitLatency) || 0, keyStats.minHitLatency),
|
|
376
|
+
maxHitLatency: Math.max(Number(existingKey.maxHitLatency) || 0, keyStats.maxHitLatency || 0),
|
|
377
|
+
minMissLatency: mergeMin(Number(existingKey.minMissLatency) || 0, keyStats.minMissLatency),
|
|
378
|
+
maxMissLatency: Math.max(Number(existingKey.maxMissLatency) || 0, keyStats.maxMissLatency || 0)
|
|
377
379
|
};
|
|
378
380
|
|
|
379
381
|
// Update context information if new data is available
|
|
@@ -385,7 +387,7 @@ class StatisticsPersistenceManager {
|
|
|
385
387
|
if (keyStats.user) updatedKeyStats.user = keyStats.user;
|
|
386
388
|
if (keyStats.locale) updatedKeyStats.locale = keyStats.locale;
|
|
387
389
|
if (keyStats.cacheOptions) updatedKeyStats.cacheOptions = keyStats.cacheOptions;
|
|
388
|
-
await UPDATE(
|
|
390
|
+
await UPDATE(KeyMetrics)
|
|
389
391
|
.set(updatedKeyStats)
|
|
390
392
|
.where({ ID: keyId, cache: this.cacheName, keyName: key });
|
|
391
393
|
}
|