mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
Add time unit suffixes to variables (#561)
Add suffixes like Ms and Ns to variables whos time unit is not in seconds. This is aligning with a new code style of putting units on variables that are not in SI base units.
This commit is contained in:
1 parent
9842705eb9
commit
c53781d16c
38 files changed
+221
-201
No files matched your search
@@ -740,10 +740,10 @@ class GaugeChild extends ValueCollectorChild {
|
||||
* seconds from when the timer was started
|
||||
*/
|
||||
startTimer() {
|
||||
let start = process.hrtime.bigint();
|
||||
let startNs = process.hrtime.bigint();
|
||||
return () => {
|
||||
let end = process.hrtime.bigint();
|
||||
this.set(Number(end - start) / 1e9);
|
||||
let endNs = process.hrtime.bigint();
|
||||
this.set(Number(endNs - startNs) / 1e9);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -979,10 +979,10 @@ class SummaryChild {
|
||||
* when the timer was started into the metric.
|
||||
*/
|
||||
startTimer() {
|
||||
let start = process.hrtime.bigint();
|
||||
let startNs = process.hrtime.bigint();
|
||||
return () => {
|
||||
let end = process.hrtime.bigint();
|
||||
this.observe(Number(end - start) / 1e9);
|
||||
let endNs = process.hrtime.bigint();
|
||||
this.observe(Number(endNs - startNs) / 1e9);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1260,10 +1260,10 @@ class HistogramChild {
|
||||
* when the timer was started into the metric.
|
||||
*/
|
||||
startTimer() {
|
||||
let start = process.hrtime.bigint();
|
||||
let startNs = process.hrtime.bigint();
|
||||
return () => {
|
||||
let end = process.hrtime.bigint();
|
||||
this.observe(Number(end - start) / 1e9);
|
||||
let endNs = process.hrtime.bigint();
|
||||
this.observe(Number(endNs - startNs) / 1e9);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user