Merge changes I75689b21,I84455a9a into main
* changes:
ui: delete TimelineCache
ui: port all main remaining tracks to use mipmap code
diff --git a/ui/src/frontend/base_counter_track.ts b/ui/src/frontend/base_counter_track.ts
index 6285b27..caf2ef6 100644
--- a/ui/src/frontend/base_counter_track.ts
+++ b/ui/src/frontend/base_counter_track.ts
@@ -785,7 +785,7 @@
}
// The underlying table has `ts` and `value` columns.
- private getSqlPreamble(): string {
+ private getValueExpression(): string {
const options = this.getCounterOptions();
let valueExpr;
@@ -804,19 +804,11 @@
assertUnreachable(options.yMode);
}
- let displayValueExpr = valueExpr;
if (options.yDisplay === 'log') {
- displayValueExpr = `ifnull(ln(${displayValueExpr}), 0)`;
+ return `ifnull(ln(${valueExpr}), 0)`;
+ } else {
+ return valueExpr;
}
-
- return `
- WITH data AS (
- SELECT
- ts,
- ${displayValueExpr} as displayValue
- FROM (${this.getSqlSource()})
- )
- `;
}
private async maybeRequestData(rawCountersKey: CacheKey) {
@@ -827,11 +819,10 @@
create virtual table counter_${this.trackKey}
using __intrinsic_counter_mipmap((
- ${this.getSqlPreamble()}
SELECT
ts,
- displayValue as value
- FROM data
+ ${this.getValueExpression()} as value
+ FROM (${this.getSqlSource()})
));
select