Implement control over default max rate for bars
This commit is contained in:
@@ -60,7 +60,13 @@ const clientOptions = [
|
|||||||
name: "metricsinterval",
|
name: "metricsinterval",
|
||||||
type: Number,
|
type: Number,
|
||||||
defaultOption: 5,
|
defaultOption: 5,
|
||||||
description: "Sets the interval for measuring metrics. A value of 5 considers the packets within the last 5 seconds. Defaults to 5."
|
description: "Interval for measuring metrics. A value of 5 considers the packets within the last 5 seconds. Defaults to 5."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "defaultmaxrate",
|
||||||
|
type: Number,
|
||||||
|
defaultOption: 1000,
|
||||||
|
description: "Default max rate for metrics/bars."
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -137,7 +143,13 @@ const centerOptions = [
|
|||||||
name: "metricsinterval",
|
name: "metricsinterval",
|
||||||
type: Number,
|
type: Number,
|
||||||
defaultOption: 5,
|
defaultOption: 5,
|
||||||
description: "Sets the interval for measuring metrics. A value of 5 considers the packets within the last 5 seconds. Defaults to 5."
|
description: "Interval for measuring metrics. A value of 5 considers the packets within the last 5 seconds. Defaults to 5."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "defaultmaxrate",
|
||||||
|
type: Number,
|
||||||
|
defaultOption: 1000,
|
||||||
|
description: "Default max rate for metrics/bars."
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@ class Metric {
|
|||||||
this.multibar = multibar;
|
this.multibar = multibar;
|
||||||
this.bar = multibar.create(0, 0);
|
this.bar = multibar.create(0, 0);
|
||||||
this.bar.update(0, { name: barName });
|
this.bar.update(0, { name: barName });
|
||||||
this.maxRate = 1000;
|
this.maxRate = this.options.defaultmaxrate;
|
||||||
this.bar.total = this.maxRate;
|
this.bar.total = this.maxRate;
|
||||||
this.buffer = new CircularBuffer(bufferSize);
|
this.buffer = new CircularBuffer(bufferSize);
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
|
Reference in New Issue
Block a user