summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/rrdFile.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/rrdFile.js b/src/lib/rrdFile.js
index f592643..aee1112 100644
--- a/src/lib/rrdFile.js
+++ b/src/lib/rrdFile.js
@@ -304,6 +304,15 @@ RRDHeader.prototype.getDS = function(idx) {
throw RangeError("DS idx ("+ idx +") out of range [0-" + this.ds_cnt +").");
}
}
+RRDHeader.prototype.getDSbyName = function(name) {
+ for (var idx=0; idx<this.ds_cnt; idx++) {
+ var ds=this.getDS(idx);
+ var ds_name=ds.getName()
+ if (ds_name==name)
+ return idx;
+ }
+ return undefined;
+}
RRDHeader.prototype.getNrRRAs = function() {
return this.rra_cnt;
@@ -346,6 +355,9 @@ function RRDFile(bf) {
this.getDS = function(idx) {
return this.rrd_header.getDS(idx);
}
+ this.getDSbyName = function(name) {
+ return this.rrd_header.getDSbyName(name);
+ }
this.getNrRRAs = function() {
return this.rrd_header.getNrRRAs();